From c8853d9ae87c3a2de2b40fc33473afdef017b82d Mon Sep 17 00:00:00 2001 From: lancegin Date: Wed, 28 Jun 2017 19:36:58 +0800 Subject: [PATCH] backup --- src/base32.js | 9 +++++++++ src/hotp.js | 10 ++++++++++ src/jsotp.js | 12 ++++++++++++ src/otp.js | 20 ++++++++++++++++++++ src/totp.js | 8 ++++++++ src/util.js | 8 ++++++++ 6 files changed, 67 insertions(+) create mode 100644 src/jsotp.js diff --git a/src/base32.js b/src/base32.js index e69de29..7032c64 100644 --- a/src/base32.js +++ b/src/base32.js @@ -0,0 +1,9 @@ +/* + * @module : BASE32 module to generate the random b32 key + * and decode the secret. + * @author : Gin (gin.lance.inside@hotmail.com) + */ + + class Base32 { + + } \ No newline at end of file diff --git a/src/hotp.js b/src/hotp.js index e69de29..c5ad118 100644 --- a/src/hotp.js +++ b/src/hotp.js @@ -0,0 +1,10 @@ +/* + * @module : HOTP module to generate and verify HOTP password + * @author : Gin (gin.lance.inside@hotmail.com) + */ + +import OTP from './otp'; + +class HOTP extends OTP { + +} \ No newline at end of file diff --git a/src/jsotp.js b/src/jsotp.js new file mode 100644 index 0000000..c446fdb --- /dev/null +++ b/src/jsotp.js @@ -0,0 +1,12 @@ +/* + * @project : jsotp + * @author : Gin (gin.lance.inside@hotmail.com) + * @link : https://github.com/LanceGin/jsotp + * @Disc : a node module to generate and verify one-time passwords + */ + +function jsotp(name) { + console.log(`Hello ${name}`); +} + +exports.jsotp = jsotp \ No newline at end of file diff --git a/src/otp.js b/src/otp.js index e69de29..d22d9c8 100644 --- a/src/otp.js +++ b/src/otp.js @@ -0,0 +1,20 @@ +/* + * @module : OTP module to generate the password + * @author : Gin (gin.lance.inside@hotmail.com) + */ + +export default class OTP { + constructor(secret, digits=6, digest="sha1") { + /* + * This constructor will create OTP instance + */ + this.secret = secret; + this.digits = digits; + this.digest = digest; + }; + + generate_otp() { + console.log("OTP.generate_otp"); + }; + } + diff --git a/src/totp.js b/src/totp.js index e69de29..ee0cee9 100644 --- a/src/totp.js +++ b/src/totp.js @@ -0,0 +1,8 @@ +/* + * @module : TOTP module to generate and verify TOTP password + * @author : Gin (gin.lance.inside@hotmail.com) + */ + + class TOTP { + + } \ No newline at end of file diff --git a/src/util.js b/src/util.js index e69de29..4862081 100644 --- a/src/util.js +++ b/src/util.js @@ -0,0 +1,8 @@ +/* + * @module : Util module to process the datas. + * @author : Gin (gin.lance.inside@hotmail.com) + */ + + class Util { + + } \ No newline at end of file