At present, the Erlang :crypto.hash(:sha512, input) is called directly when creating a cid:
|
hash = :crypto.hash(:sha512, input) |
In light of the fact that https://github.com/ipld/cid achieves a pretty similar goal,
I propose that we use multihash instead of directly creating a :sha512 hash.
This will ensure forward compatibility and also mean that we can use the JS cid function on the client.
Todo
At present, the Erlang
:crypto.hash(:sha512, input)is called directly when creating acid:cid/lib/cid.ex
Line 25 in 3e8eb82
In light of the fact that https://github.com/ipld/cid achieves a pretty similar goal,
I propose that we use
multihashinstead of directly creating a:sha512hash.This will ensure forward compatibility and also mean that we can use the JS
cidfunction on the client.Todo
https://github.com/multiformats/ex_multihash/blob/dd3ce7e39d053049dbd7219c2aba2dbde9940bb2/test/multihash_test.exs#L3