Skip to content

Commit

Permalink
update documentation on functions #11
Browse files Browse the repository at this point in the history
  • Loading branch information
RobStallion committed Jan 29, 2019
1 parent 1ae6128 commit 8a21996
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/cid.ex
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ defmodule Cid do
defp create_cid({:error, msg}), do: msg

# takes a multihash and retuns a CID
# B58.encode58 takes the binary returned from create_cid_suffix and converts
# it into a base58 string. For more info on base58 strings see
# https://en.wikipedia.org/wiki/Base58
defp create_cid(multihash) when is_binary(multihash) do
multihash
|> create_cid_suffix()
Expand All @@ -76,7 +79,7 @@ defmodule Cid do
# <version><multicodec-packed-content-type><multihash>
defp create_cid_suffix(multihash), do: <<1>> <> "U" <> multihash

# adds the multibase prefix to the suffix (<version><mc><mh>)
# adds the multibase prefix (multibase-prefix) to the suffix (<version><mc><mh>)
defp add_multibase_prefix(suffix), do: "z" <> suffix

# adds new line to the end of string. (exists because all tests with ipfs
Expand Down

0 comments on commit 8a21996

Please sign in to comment.