Comparing version 0.0.1 to 0.0.2
@@ -54,5 +54,10 @@ /* | ||
function verify(x) { | ||
return false; | ||
} | ||
OTP.longToBytes = longToBytes; | ||
OTP.prototype.at = at; | ||
OTP.prototype.verify = verify; | ||
module.exports = OTP; |
@@ -46,4 +46,9 @@ /* | ||
function verify(x) { | ||
return this.now() == x; | ||
} | ||
TOTP.prototype.at = at; | ||
TOTP.prototype.now = now; | ||
TOTP.prototype.timeCode = timeCode; | ||
OTP.prototype.verify = verify; |
{ | ||
"name": "onceler", | ||
"description": "OTP (One Time Password) facilities for node.", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"engines": { | ||
@@ -6,0 +6,0 @@ "node": ">=0.2.6" |
@@ -19,2 +19,9 @@ | ||
console.log(totp.now()); | ||
// verify a user supplied value | ||
if(totp.verify(1234567)) { | ||
console.log('access granted!'); | ||
} else { | ||
console.log('access denied!'); | ||
} | ||
@@ -21,0 +28,0 @@ LICENSE |
@@ -35,2 +35,8 @@ /* | ||
}); | ||
it('should verify', function() { | ||
var totp = new TOTP('IFAUCQKCIJBEE==='); | ||
var x = totp.now(); | ||
expect(totp.verify(x)).toBeTruthy(); | ||
}); | ||
@@ -37,0 +43,0 @@ it('should get value at an index of a specified digit size', function() { |
17308
199
48