From 9358117c4b1cc3e5bc17bc9d403d81ca9fe63733 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 22 Oct 2015 21:27:32 -0700 Subject: [PATCH] browser fork --- examples/TOTP-verify.js | 33 --------------------------------- examples/TOTP.js | 15 --------------- 2 files changed, 48 deletions(-) delete mode 100644 examples/TOTP-verify.js delete mode 100644 examples/TOTP.js diff --git a/examples/TOTP-verify.js b/examples/TOTP-verify.js deleted file mode 100644 index 78dedd2..0000000 --- a/examples/TOTP-verify.js +++ /dev/null @@ -1,33 +0,0 @@ - -var notp = require('../index'), - t2 = require('thirty-two'), - K = '12345678901234567890', - b32 = t2.encode(K); - -console.log('Click on this link to gennerate a QR code, and use Google Authenticator on your phone to read it:'); -console.log('http://qrcode.kaywa.com/img.php?s=8&d=' + encodeURIComponent('otpauth://totp/notp@example.com?secret=' + b32)); -verify(); - -function verify() { - ask('Enter a code to verify', function(code) { - if(notp.totp.verify(code, K, {})) { - console.log('Success!!!'); - } - console.log(notp.totp.verify(code, K, {})); - verify(); - }); -} - - - -function ask(question, callback) { - var stdin = process.stdin, stdout = process.stdout; - - stdin.resume(); - stdout.write(question + ": "); - - stdin.once('data', function(data) { - data = data.toString().trim(); - callback(data); - }); -} diff --git a/examples/TOTP.js b/examples/TOTP.js deleted file mode 100644 index b81a21c..0000000 --- a/examples/TOTP.js +++ /dev/null @@ -1,15 +0,0 @@ - -var notp = require('../index'), - t2 = require('thirty-two'), - K = '12345678901234567890', - b32 = t2.encode(K); - -console.log('Getting current counter value for K = 12345678901234567890'); -console.log('This has a base32 value of ' + b32); -console.log('The base32 value should be entered in the Google Authenticator App'); -console.log(''); -console.log('Open the following URL for a QR code. Google Authenticator can read this QR code using your phone\'s camera:'); -console.log('http://qrcode.kaywa.com/img.php?s=8&d=' + encodeURIComponent('otpauth://totp/notp@example.com?secret=' + b32)); - -console.log('The current TOTP value is ' + notp.totp.gen(K, {})); -