Skip to content

Commit

Permalink
Cleaned up readme a bit
Browse files Browse the repository at this point in the history
Related to #8
  • Loading branch information
RichardLitt committed Jun 22, 2016
1 parent 14308a4 commit 110fb97
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
# multihash

> hashpipe - pipe iff the hash matches
Multihash is a protocol for differentiating outputs from various well-established cryptographic hash functions, addressing size + encoding considerations.

It is useful to write applications that future-proof their use of hashes, and allow multiple hash functions to coexist. See https://github.com/jbenet/random-ideas/issues/1 for a longer discussion.
It is useful to write applications that future-proof their use of hashes, and allow multiple hash functions to coexist. See [this GitHub thread](https://github.com/jbenet/random-ideas/issues/1) for a longer discussion.

## Table of Contents

- [Example](#example)
- [Format](#format)
- [Implementations:](#implementations)
- [Table for Multihash v1.0.0-RC (semver)](#table-for-multihash-v100-rc-semver)
- [Disclaimers](#disclaimers)
- [Contribute](#contribute)
- [License](#license)

## Example

Expand All @@ -22,7 +34,7 @@ QmRJzsvyCQyizr73Gmms8ZRtvNxmgqumxc2KUp71dfEmoj # sha256 in base58
EiAsJrRraP/Gj/mbRTwdMEE0E0ItcGSDv6D5il6IYmbnrg== # sha256 in base64
```

## format
## Format

```
<1-byte hash function code><1-byte digest size in bytes><hash function output>
Expand Down Expand Up @@ -62,7 +74,7 @@ Because aesthetically I prefer the code first. You already have to write your st
- [ruby-multihash](//github.com/neocities/ruby-multihash)
- [scala-multihash](//github.com/mediachain/scala-multihash)

## table for Multihash v1.0.0-RC (semver)
## Table for Multihash v1.0.0-RC (semver)

The current multihash table is [here](hashtable.csv):

Expand All @@ -85,7 +97,7 @@ code name
```


### other tables
### Other Tables

Cannot find a good standard on this. Found some _different_ IANA ones:

Expand All @@ -98,4 +110,10 @@ They disagree. :(

Warning: **obviously multihash values bias the first two bytes**. Do not expect them to be uniformly distributed. The entropy size is `len(multihash) - 2`. Skip the first two bytes when using them with bloom filters, etc. Why not _ap_pend instead of _pre_pend? Because when reading a stream of hashes, you can know the length of the hash (from the table).

License: MIT
## Contribute

PRs and help welcomed. [Take a look at the issues](https://github.com/jbenet/multihash/issues)!

## Licenst

MIT

0 comments on commit 110fb97

Please sign in to comment.