diff --git a/codex/utils/digest.nim b/codex/utils/digest.nim new file mode 100644 index 00000000..a33a769d --- /dev/null +++ b/codex/utils/digest.nim @@ -0,0 +1,7 @@ +import pkg/libp2p/multihash + +template bytes*(mh: MultiHash): seq[byte] = + ## get the hash bytes of a multihash object + ## + + mh.data.buffer[mh.dpos..(mh.dpos + mh.size - 1)]