Comments (4)
@theobat thank you for this #7 ❤️
from js-multibase.
hi @diasdavid, it seems it can be any of each base's version since it takes the alphabet as an argument :
var BASE58_BITCOIN = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
var BASE58_FLICKR = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'
var BASE58_RIPPLE = 'rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz'
var bs58btc = require('base-x')(BASE58_BITCOIN)
var bs58flickr = require('base-x')(BASE58_FLICKR)
var bs58ripple = require('base-x')(BASE58_RIPPLE)
// encode-decode with the alphabet you'd like
So I guess we only have to map the alphabets to the constants in Constants.js ?
from js-multibase.
@theobat awesome! Yeah, seems like that then, constants.js can be the human readable name, the short version and the encoder/decoder instance. Would you like to contribute with PR adding this?
Thank you for checking how to make this work :)
from js-multibase.
@diasdavid Sure! I'll try to open a PR today, but I thought it could be nice to use an object-oriented declaration of the Bases such as jbenet mentioned here. It won't be as useful as in Go but I think it would clarify the initialization. What do you think ?
Would be something like :
const constants = {
base1: Base('1', '1'),
base2: Base('0', '01'),
base8: Base('7', '01234567'),
// ... Base(code, alphabet) ... etc
}
from js-multibase.
Related Issues (20)
- ReferenceError: TextDecoder is not defined
- Move from Coveralls to CodeCov.io HOT 2
- base32 is broken HOT 3
- base64pad/base64urlpad not yet implemented HOT 3
- Ambigous encoding due to underlying design HOT 1
- typescript support HOT 2
- suggest to add suuport base58 HOT 1
- [Bug] Incorrect implementation for base58btc HOT 5
- Test against spec
- Standardize README HOT 1
- More description error text
- Export the names and codes as object (instead of array)
- Implement base36 HOT 1
- `web-encoding` package causes problems with jest in env=node and env=jsdom HOT 19
- QUESTION: how to get the string from the encode function HOT 12
- Upgrade to aegir@9 HOT 1
- Incompatibility with "zii" HOT 13
- Recent release broke our build HOT 2
- ReferenceError: TextDecoder is not defined HOT 1
- React Native support is dropped HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-multibase.