mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-05-21 23:21:19 +00:00
69 lines
2.5 KiB
Markdown
69 lines
2.5 KiB
Markdown
|
# rust-multihash
|
||
|
|
||
|
[](http://ipn.io)
|
||
|
[](https://github.com/multiformats/multiformats)
|
||
|
[](https://webchat.freenode.net/?channels=%23ipfs)
|
||
|
[](https://travis-ci.org/multiformats/rust-multihash)
|
||
|
[](https://codecov.io/github/multiformats/rust-multihash?branch=master)
|
||
|
[](https://docs.rs/multihash/)
|
||
|
[](https://crates.io/crates/multihash)
|
||
|
[](https://github.com/RichardLitt/standard-readme)
|
||
|
|
||
|
> [multihash](https://github.com/multiformats/multihash) implementation in Rust.
|
||
|
|
||
|
## Table of Contents
|
||
|
|
||
|
- [Install](#install)
|
||
|
- [Usage](#usage)
|
||
|
- [Supported Hash Types](#supported-hash-types)
|
||
|
- [Dependencies](#dependencies)
|
||
|
- [Maintainers](#maintainers)
|
||
|
- [Contribute](#contribute)
|
||
|
- [License](#license)
|
||
|
|
||
|
## Install
|
||
|
|
||
|
First add this to your `Cargo.toml`
|
||
|
|
||
|
```toml
|
||
|
[dependencies]
|
||
|
multihash = "*"
|
||
|
```
|
||
|
|
||
|
Then run `cargo build`.
|
||
|
|
||
|
## Usage
|
||
|
|
||
|
```rust
|
||
|
extern crate multihash;
|
||
|
|
||
|
use multihash::{encode, decode, Hash};
|
||
|
|
||
|
let hash = encode(Hash::SHA2256, b"my hash").unwrap();
|
||
|
let multi = decode(&hash).unwrap();
|
||
|
```
|
||
|
|
||
|
## Supported Hash Types
|
||
|
|
||
|
* `SHA1`
|
||
|
* `SHA2-256`
|
||
|
* `SHA2-512`
|
||
|
* `SHA3`/`Keccak`
|
||
|
|
||
|
## Maintainers
|
||
|
|
||
|
Captain: [@dignifiedquire](https://github.com/dignifiedquire).
|
||
|
|
||
|
## Contribute
|
||
|
|
||
|
Contributions welcome. Please check out [the issues](https://github.com/multiformats/rust-multihash/issues).
|
||
|
|
||
|
Check out our [contributing document](https://github.com/multiformats/multiformats/blob/master/contributing.md) for more information on how we work, and about contributing in general. Please be aware that all interactions related to multiformats are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
|
||
|
|
||
|
Small note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.
|
||
|
|
||
|
|
||
|
## License
|
||
|
|
||
|
[MIT](LICENSE) © 2015-2017 Friedel Ziegelmayer
|