mirror of
https://github.com/LanceGin/jsotp.git
synced 2026-02-07 00:00:03 +08:00
21 lines
590 B
JavaScript
21 lines
590 B
JavaScript
var b32 = require('../lib/base32');
|
|
var assert = require('assert');
|
|
|
|
describe('Base32 module test', function() {
|
|
|
|
var a = b32.Base32;
|
|
|
|
describe('static decode() function', function() {
|
|
it("should print 'Hello, World!'", function() {
|
|
assert.equal("Hello, World!", a.decode("JBSWY3DPFQQFO33SNRSCC====="));
|
|
});
|
|
});
|
|
|
|
describe('static random_gen() function', function() {
|
|
it("should print 'static Base32.random_gen'", function() {
|
|
let length = 16;
|
|
assert(length, a.random_gen(length).length);
|
|
})
|
|
})
|
|
});
|