diff --git a/src/base32.js b/src/base32.js index af7022c..ece722c 100644 --- a/src/base32.js +++ b/src/base32.js @@ -4,12 +4,23 @@ * @author : Gin (gin.lance.inside@hotmail.com) */ - export class Base32 { - static decode() { - return "static Base32.decode"; +const nibbler = require("./nibbler/nibbler"); + +export class Base32 { + /** + * Base32 decode function + * + * @param {secret} + * @type {String} + * @desc input string + * + * @return {String} + */ + static decode(secret) { + return nibbler.b32decode(secret); } static random_gen() { return "static Base32.random_gen"; } - } \ No newline at end of file +} \ No newline at end of file diff --git a/test/b32_test.js b/test/b32_test.js index c77b097..1f9a4df 100644 --- a/test/b32_test.js +++ b/test/b32_test.js @@ -6,8 +6,8 @@ describe('Base32 module test', function() { var a = b32.Base32; describe('static decode() function', function() { - it("should print 'static Base32.decode'", function() { - assert.equal("static Base32.decode", a.decode()); + it("should print 'Hello, World!'", function() { + assert.equal("Hello, World!", a.decode("JBSWY3DPFQQFO33SNRSCC=====")); }); });