https://github.com/coinspace/base58-monero
Base58 Monero style
https://github.com/coinspace/base58-monero
base58 decoding encoding monero
Last synced: 13 days ago
JSON representation
Base58 Monero style
- Host: GitHub
- URL: https://github.com/coinspace/base58-monero
- Owner: CoinSpace
- License: mit
- Created: 2021-02-25T19:47:38.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-07-21T15:12:48.000Z (almost 4 years ago)
- Last Synced: 2025-03-27T18:52:41.621Z (about 1 month ago)
- Topics: base58, decoding, encoding, monero
- Language: JavaScript
- Homepage:
- Size: 320 KB
- Stars: 3
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# base58-monero
[](https://github.com/CoinSpace/base58-monero/actions/workflows/ci.yml)
[](https://www.npmjs.com/package/base58-monero)
[](https://www.npmjs.com/package/base58-monero)
[](https://github.com/CoinSpace/base58-monero/blob/master/LICENSE)Base58 Monero style.
## Base58 in Monero
Monero has its own variant of Base58.
In Monero the Base58 encoding is performed in 8-byte blocks, except the last block which is the remaining (8 or less) bytes.
The 8-byte block converts to 11 or less Base58 characters. If the block converted to less then 11 characters, the output is padded with "1"s (0 in Base58). The final block is padded as well to whatever would be the maximum size of this number of bytes encoded in Base58.
The advantage of Monero implementation is that output is of a fixed size which is not the case with plain Base58. The disadvantage is that default libraries won't work.
# Install
```
npm i --save base58-monero
```## API
### encode(buffer: Buffer | Uint8Array)
Encode `Buffer` or `Uint8Array` as base58 `string`.
### decode(str: string)
Decode base58 `string` to `Buffer`.
## More
* [reference C++ Base58 implementation](https://github.com/monero-project/monero/blob/master/src/common/base58.cpp)
## Credits
[Coin Crypto Wallet](https://github.com/CoinSpace).
## License
MIT