Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Commit

Permalink
Update import path across packages
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoMiguens committed Jul 17, 2019
1 parent 8f2b7d9 commit 14623cc
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/src/hotp.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
///
import 'otp.dart';
import 'package:dart_otp/src/otp_type.dart';
import 'package:dart_otp/src/components/otp_type.dart';

class HOTP extends OTP {
@override
Expand Down
7 changes: 4 additions & 3 deletions lib/src/otp.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import 'dart:math';
import 'package:crypto/crypto.dart';
import 'package:base32/base32.dart';
import 'package:dart_otp/src/otp_type.dart';
import 'package:dart_otp/src/components/otp_algorithm.dart';
import 'package:dart_otp/src/components/otp_type.dart';
import 'util.dart';

abstract class OTP {
Expand Down Expand Up @@ -53,12 +54,12 @@ abstract class OTP {
///
/// @return {String}
///
String generateOTP({int input}) {
String generateOTP({int input, OTPAlgorithm algorithm = OTPAlgorithm.SHA1}) {
/// base32 decode the secret
var hmacKey = base32.decode(this.secret);

/// initial the HMAC-SHA1 object
var hmacSha1 = Hmac(sha1, hmacKey);
var hmacSha1 = createHmacFor(algorithm: algorithm, key: hmacKey);

/// get hmac answer
var hmac = hmacSha1.convert(Util.intToBytelist(input: input)).bytes;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/totp.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
///
import 'otp.dart';
import 'otp_type.dart';
import 'components/otp_type.dart';
import 'util.dart';

class TOTP extends OTP {
Expand Down
2 changes: 1 addition & 1 deletion test/hotp_test.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:dart_otp/dart_otp.dart';
import 'package:dart_otp/src/otp_type.dart';
import 'package:dart_otp/src/components/otp_type.dart';
import 'package:test/test.dart';

void main() {
Expand Down
2 changes: 1 addition & 1 deletion test/totp_test.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:dart_otp/dart_otp.dart';
import 'package:dart_otp/src/otp_type.dart';
import 'package:dart_otp/src/components/otp_type.dart';
import 'package:test/test.dart';

void main() {
Expand Down

0 comments on commit 14623cc

Please sign in to comment.