Skip to content
This repository has been archived by the owner on Aug 24, 2021. It is now read-only.

Commit

Permalink
feat: remove base1
Browse files Browse the repository at this point in the history
We've removed it from the multibase spec:

* multiformats/multibase#48
* multiformats/multibase#57

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
  • Loading branch information
Stebalien committed Jul 26, 2019
1 parent 1ae01a0 commit f195b2e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,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']
Expand All @@ -159,7 +158,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
Expand Down
1 change: 0 additions & 1 deletion src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const base64 = require('./base64')

// name, code, implementation, alphabet
const constants = [
['base1', '1', '', '1'],
['base2', '0', baseX, '01'],
['base8', '7', baseX, '01234567'],
['base10', '9', baseX, '0123456789'],
Expand Down
6 changes: 2 additions & 4 deletions test/multibase.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down Expand Up @@ -96,7 +94,7 @@ describe('multibase', () => {

it('fails on no buf', () => {
expect(() => {
multibase('base1')
multibase('base16')
}).to.throw(Error)
})

Expand Down

0 comments on commit f195b2e

Please sign in to comment.