diff --git a/README.md b/README.md index fde607d..6064b86 100644 --- a/README.md +++ b/README.md @@ -62,15 +62,12 @@ Loading this module through a script tag will make the ```Multibase``` obj avail ``` -#### Gotchas - -You will need to use Node.js `Buffer` API compatible, if you are running inside the browser, you can access it by `multibase.Buffer` or you can load Feross's [Buffer](https://github.com/feross/buffer) module. - ## Usage ### Example ```JavaScript +const { Buffer } = require('buffer') const multibase = require('multibase') const encodedBuf = multibase.encode('base58btc', new Buffer('hey, how is it going')) @@ -147,7 +144,6 @@ const baseX = require('base-x') //const newPackage = require('your-package-name') const constants = [ - ['base1', '1', '', '1'], ['base2', '0', baseX, '01'], ['base8', '7', baseX, '01234567'], // ... [ 'your-base-name', 'code-to-be-defined', newPackage, 'alphabet'] @@ -157,7 +153,7 @@ The required package defines the implementation of the encoding/decoding process - `encode` and `decode` functions with to-be-encoded buffer as the only expected argument - the require call use the `alphabet` given as an argument for the encoding/decoding process -*If no package is specified (such as for base1 in the above example, it means the base is not implemented yet)* +*If no package is specified , it means the base is not implemented yet* Adding a new base requires the tests to be updated. Test files to be updated are : - constants.spec.js @@ -200,4 +196,4 @@ Small note: If editing the README, please conform to the [standard-readme](https ## License -[MIT](LICENSE) © 2016 Protocol Labs Inc. +[MIT](LICENSE) © Protocol Labs Inc. diff --git a/test/multibase.spec.js b/test/multibase.spec.js index 423c17b..bbd3ef0 100644 --- a/test/multibase.spec.js +++ b/test/multibase.spec.js @@ -8,9 +8,7 @@ chai.use(dirtyChai) const multibase = require('../src') const constants = require('../src/constants.js') -const unsupportedBases = [ - ['base1'] -] +const unsupportedBases = [] const supportedBases = [ ['base2', 'yes mani !', '01111001011001010111001100100000011011010110000101101110011010010010000000100001'], @@ -99,7 +97,7 @@ describe('multibase', () => { it('fails on no buf', () => { expect(() => { - multibase('base1') + multibase('base16') }).to.throw(Error) })