get digest bytes

This commit is contained in:
Dmitriy Ryajov 2023-10-23 19:39:47 -06:00
parent 9e076ae349
commit 9cd2af6cec
No known key found for this signature in database
GPG Key ID: DA8C680CE7C657A4

7
codex/utils/digest.nim Normal file
View File

@ -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)]