test.js 364B

1234567891011121314
  1. var assert = require('assert')
  2. var Base62 = require('../base62')
  3. describe("encode", function() {
  4. it("should encode a number to a Base62 string", function() {
  5. assert.equal(Base62.encode(999), 'g7')
  6. });
  7. });
  8. describe("decode", function() {
  9. it("should decode a number from a Base62 string", function() {
  10. assert.equal(Base62.decode('g7'), 999)
  11. });
  12. });