mirror of
https://github.com/LanceGin/jsotp.git
synced 2026-04-17 00:01:31 +08:00
add: HOTP.at and HOTP.verify functions
This commit is contained in:
+6
-5
@@ -4,17 +4,18 @@ var assert = require('assert');
|
||||
describe('HOTP module test', function() {
|
||||
|
||||
var HOTP = hotp.HOTP;
|
||||
var a = new HOTP("BASE32_ENCODED_SECRET");
|
||||
var a = new HOTP("J22U6B3WIWRRBTAV");
|
||||
|
||||
describe('at() function', function() {
|
||||
it("should print 'HOTP.at'", function() {
|
||||
assert.equal("HOTP.at", a.at());
|
||||
it("should return string", function() {
|
||||
assert.equal("string", typeof(a.at(0)));
|
||||
});
|
||||
});
|
||||
|
||||
describe('verify() function', function() {
|
||||
it("should print 'HOTP.verify'", function() {
|
||||
assert.equal("HOTP.verify", a.verify());
|
||||
it("should verify the digit", function() {
|
||||
assert.equal(true, a.verify(a.at(0), 0));
|
||||
assert.equal(false, a.verify(a.at(0), 1));
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user