https://github.com/docknetwork/multibase-cli
command line tool for converting to and from multibase encodings
https://github.com/docknetwork/multibase-cli
Last synced: 2 months ago
JSON representation
command line tool for converting to and from multibase encodings
- Host: GitHub
- URL: https://github.com/docknetwork/multibase-cli
- Owner: docknetwork
- Created: 2019-10-23T20:04:09.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-23T23:34:48.000Z (over 6 years ago)
- Last Synced: 2025-12-30T19:31:13.986Z (6 months ago)
- Language: Rust
- Size: 8.79 KB
- Stars: 0
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Multibase converter
[](https://crates.io/crates/multibase-cli)
Command line tool for converting {to,from,between}
[multibase](https://tools.ietf.org/html/draft-multiformats-multibase-00) encodings.
Uses the [multibase crate](https://crates.io/crates/multibase).
## Usage
```bash
echo -n "hey" | multibase base2
# 011010000110010101111001
multibase decode 011010000110010101111001
# hey
echo -n 011010000110010101111001 | multibase decode
# hey
```
Multibase **does** encode newlines.
```bash
echo hey | multibase base58btc
# z3fmoA9
echo -n hey | multibase base58btc
# zc4oi
```
Multibase is strict about the input it accepts. It won't decode newlines unless they are valid
parts of the input encoding.
```bash
# this will fail because echo appends a '\n' character to its output
echo 011010000110010101111001 | multibase decode
# try one of these instead
echo -n 011010000110010101111001 | multibase decode
printf "%s" 011010000110010101111001 | multibase decode
multibase decode 011010000110010101111001
```
## Installation
```bash
cargo install multibase-cli
```
## Known issues
Multibase encodings with padding are not yet supported. To make them supported,
[rust-multibase](https://github.com/multiformats/rust-multibase) must push recent changes to
crates.io. https://github.com/multiformats/rust-multibase/issues/12
The `identity` encoding is not yet supported.
## License
Licensed under either of
* Apache License, Version 2.0
([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license
([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.
## Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.