This module implements MultiHash. Supported hashes are:
- IDENTITY
- SHA2-256/SHA2-512
- DBL-SHA2-256
- SHA3/KECCAK
- SHAKE-128/SHAKE-256
- BLAKE2s/BLAKE2s
- SHA1
Hashes which are not yet supported
- SKEIN
- MURMUR
Types
MHash = object mcodec*: MultiCodec size*: int coder*: MHashCoderProc
- Source Edit
MHashCoderProc = proc (data: openArray[byte]; output: var openArray[byte]) {. nimcall, ...gcsafe, noSideEffect, ...raises: [].}
- Source Edit
MultiHash = object data*: VBuffer mcodec*: MultiCodec size*: int dpos*: int
- Source Edit
Consts
CodeHashes = (data: [(742162026959085568, 45606, (mcodec: 45606, size: 38, coder: blake2Bhash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( 36677678648926210, 45605, (mcodec: 45605, size: 37, coder: blake2Bhash)), ( -7201032570005723901, 45576, (mcodec: 45576, size: 8, coder: blake2Bhash)), ( 7339157277795642115, 45613, (mcodec: 45613, size: 45, coder: blake2Bhash)), ( -7961417004875224829, 45614, (mcodec: 45614, size: 46, coder: blake2Bhash)), ( 7477027946331342595, 45654, (mcodec: 45654, size: 22, coder: blake2Shash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( 6519099477057574925, 45603, (mcodec: 45603, size: 35, coder: blake2Bhash)), ( -9107414096075663602, 45636, (mcodec: 45636, size: 4, coder: blake2Shash)), ( 3702202530071399695, 45591, (mcodec: 45591, size: 23, coder: blake2Bhash)), ( -3558065071486297840, 52496, (mcodec: 52496, size: 32, coder: poseidon2_sponge_rate2)), ( 3778286363292740369, 45628, (mcodec: 45628, size: 60, coder: blake2Bhash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( -1490805819673923818, 26, (mcodec: 26, size: 28, coder: keccak_224hash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( -850023801842585574, 45661, (mcodec: 45661, size: 29, coder: blake2Shash)), ( -8582587064454018277, 45608, (mcodec: 45608, size: 40, coder: blake2Bhash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( -441391754489415905, 19, (mcodec: 19, size: 64, coder: sha2_512hash)), ( -341693516753200864, 45601, (mcodec: 45601, size: 33, coder: blake2Bhash)), ( 6636623100242198561, 45588, (mcodec: 45588, size: 20, coder: blake2Bhash)), ( 3825180114601473570, 45589, (mcodec: 45589, size: 21, coder: blake2Bhash)), ( -4730492554605742816, 45604, (mcodec: 45604, size: 36, coder: blake2Bhash)), ( 3886575830773705252, 45597, (mcodec: 45597, size: 29, coder: blake2Bhash)), ( -3614833341134613216, 45624, (mcodec: 45624, size: 56, coder: blake2Bhash)), ( -2349507974829865437, 45627, (mcodec: 45627, size: 59, coder: blake2Bhash)), ( -368647586693185753, 45646, (mcodec: 45646, size: 14, coder: blake2Shash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( -2126208313714650581, 45642, (mcodec: 45642, size: 10, coder: blake2Shash)), ( -447744914776150996, 45585, (mcodec: 45585, size: 17, coder: blake2Bhash)), ( 7564727968965015597, 45602, (mcodec: 45602, size: 34, coder: blake2Bhash)), ( 4762255665344611372, 45632, (mcodec: 45632, size: 64, coder: blake2Bhash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( 3306433508899056945, 45615, (mcodec: 45615, size: 47, coder: blake2Bhash)), ( -2187101532251031758, 45577, (mcodec: 45577, size: 9, coder: blake2Bhash)), ( 2270038225315523890, 45635, (mcodec: 45635, size: 3, coder: blake2Shash)), ( -3833495827472691663, 45649, (mcodec: 45649, size: 17, coder: blake2Shash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( -7493862433574289860, 45579, (mcodec: 45579, size: 11, coder: blake2Bhash)), ( 4015511496382627645, 45607, (mcodec: 45607, size: 39, coder: blake2Bhash)), ( 3139262928801305150, 45592, (mcodec: 45592, size: 24, coder: blake2Bhash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( 4665004266251396417, 45655, (mcodec: 45655, size: 23, coder: blake2Shash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( 8148044485523974467, 45630, (mcodec: 45630, size: 62, coder: blake2Bhash)), ( 8089268148560331332, 45580, (mcodec: 45580, size: 12, coder: blake2Bhash)), ( -8155961528013116859, 45590, (mcodec: 45590, size: 22, coder: blake2Bhash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( -5942462881323775926, 45621, (mcodec: 45621, size: 53, coder: blake2Bhash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( 3722469361491793743, 45647, (mcodec: 45647, size: 15, coder: blake2Shash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( 1478686420057981010, 52497, (mcodec: 52497, size: 32, coder: poseidon2_merkle_2kb_sponge)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( -5671128966701617579, 17, (mcodec: 17, size: 20, coder: sha1hash)), ( -7117964061007598762, 45578, (mcodec: 45578, size: 10, coder: blake2Bhash)), ( 7592383658340307541, 45581, (mcodec: 45581, size: 13, coder: blake2Bhash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( 4081381293664816729, 18, (mcodec: 18, size: 32, coder: sha2_256hash)), ( 5194128344569358938, 45586, (mcodec: 45586, size: 18, coder: blake2Bhash)), ( -5224028828087935397, 45570, (mcodec: 45570, size: 2, coder: blake2Bhash)), ( 8878245535350094426, 45598, (mcodec: 45598, size: 30, coder: blake2Bhash)), ( -8596929811695276709, 45611, (mcodec: 45611, size: 43, coder: blake2Bhash)), ( 1619204597873070430, 45623, (mcodec: 45623, size: 55, coder: blake2Bhash)), ( 8457817737669516893, 45633, (mcodec: 45633, size: 1, coder: blake2Shash)), ( 5234848922351937370, 45645, (mcodec: 45645, size: 13, coder: blake2Shash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( -4905469964770678428, 27, (mcodec: 27, size: 32, coder: keccak_256hash)), ( -5508519877172955548, 45634, (mcodec: 45634, size: 2, coder: blake2Shash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( -6799256473720263320, 45573, (mcodec: 45573, size: 5, coder: blake2Bhash)), ( -5940405725068231575, 0, (mcodec: 0, size: 0, coder: identhash)), ( 4933907647872577386, 86, (mcodec: 86, size: 32, coder: dblsha2_256hash)), ( -1497651696503691672, 45616, (mcodec: 45616, size: 48, coder: blake2Bhash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( 5247198278916638061, 45652, (mcodec: 45652, size: 20, coder: blake2Shash)), ( 3662154777125058926, 45651, (mcodec: 45651, size: 19, coder: blake2Shash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( -5432488932650698127, 23, (mcodec: 23, size: 28, coder: sha3_224hash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( -4286965168729550477, 21, (mcodec: 21, size: 48, coder: sha3_384hash)), ( -884978693998249101, 45637, (mcodec: 45637, size: 5, coder: blake2Shash)), ( 1938680534663022965, 45656, (mcodec: 45656, size: 24, coder: blake2Shash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( 2013969887802770300, 45625, (mcodec: 45625, size: 57, coder: blake2Bhash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( 7593982011112544638, 45617, (mcodec: 45617, size: 49, coder: blake2Bhash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( -2415918218869118075, 45571, (mcodec: 45571, size: 3, coder: blake2Bhash)), ( -7888944182433986682, 45653, (mcodec: 45653, size: 21, coder: blake2Shash)), ( 2208112073401957767, 45618, (mcodec: 45618, size: 50, coder: blake2Bhash)), ( 9101838478930802312, 45569, (mcodec: 45569, size: 1, coder: blake2Bhash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( 5180782015799665035, 45600, (mcodec: 45600, size: 32, coder: blake2Bhash)), ( 4144274057557948043, 45648, (mcodec: 45648, size: 16, coder: blake2Shash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( 6734420756275004303, 45593, (mcodec: 45593, size: 25, coder: blake2Bhash)), ( 7099601067907714704, 45659, (mcodec: 45659, size: 27, coder: blake2Shash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( 8110028635658384274, 45575, (mcodec: 45575, size: 7, coder: blake2Bhash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( 7648092725620566422, 22, (mcodec: 22, size: 32, coder: sha3_256hash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( 1466691590100557210, 29, (mcodec: 29, size: 64, coder: keccak_512hash)), ( -5656623721934920038, 45595, (mcodec: 45595, size: 27, coder: blake2Bhash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( -2421578015818886752, 45660, (mcodec: 45660, size: 28, coder: blake2Shash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( 3397904103838461858, 45626, (mcodec: 45626, size: 58, coder: blake2Bhash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( -7417991279279535450, 45587, (mcodec: 45587, size: 19, coder: blake2Bhash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( 6855020105306968745, 45631, (mcodec: 45631, size: 63, coder: blake2Bhash)), ( 1218547197955980714, 45620, (mcodec: 45620, size: 52, coder: blake2Bhash)), ( 151826196472886187, 45662, (mcodec: 45662, size: 30, coder: blake2Shash)), ( 7259132617082228396, 28, (mcodec: 28, size: 48, coder: keccak_384hash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( 5285797925950146478, 45650, (mcodec: 45650, size: 18, coder: blake2Shash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( -9101960084582138958, 45572, (mcodec: 45572, size: 4, coder: blake2Bhash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( 6234276025881256628, 45574, (mcodec: 45574, size: 6, coder: blake2Bhash)), ( -2140998982205634635, 45594, (mcodec: 45594, size: 26, coder: blake2Bhash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( -3591925052192832068, 45596, (mcodec: 45596, size: 28, coder: blake2Bhash)), ( -5038980724960721732, 45629, (mcodec: 45629, size: 61, coder: blake2Bhash)), ( -9123463841657500226, 45612, (mcodec: 45612, size: 44, coder: blake2Bhash)), ( 6432776627724841406, 45658, (mcodec: 45658, size: 26, coder: blake2Shash)), ( -2697042507132587840, 20, (mcodec: 20, size: 64, coder: sha3_512hash)), ( 7357336765892928449, 45582, (mcodec: 45582, size: 14, coder: blake2Bhash)), ( 5114972212729830850, 45599, (mcodec: 45599, size: 31, coder: blake2Bhash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( -429432048387042869, 45619, (mcodec: 45619, size: 51, coder: blake2Bhash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( -2403362734075213874, 45643, (mcodec: 45643, size: 11, coder: blake2Shash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( 66305509912956625, 45664, (mcodec: 45664, size: 32, coder: blake2Shash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( -4705987911057101356, 45610, (mcodec: 45610, size: 42, coder: blake2Bhash)), ( -294823440907763756, 45640, (mcodec: 45640, size: 8, coder: blake2Shash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( -9071603870244226088, 25, (mcodec: 25, size: 64, coder: shake_256hash)), ( 172971162102489304, 45641, (mcodec: 45641, size: 9, coder: blake2Shash)), ( -5178260970169554727, 45663, (mcodec: 45663, size: 31, coder: blake2Shash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( 3744876744046340577, 45657, (mcodec: 45657, size: 25, coder: blake2Shash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( -5911269151717642772, 45609, (mcodec: 45609, size: 41, coder: blake2Bhash)), ( -5306508683095530260, 45638, (mcodec: 45638, size: 6, coder: blake2Shash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( -8586188276610049041, 45644, (mcodec: 45644, size: 12, coder: blake2Shash)), ( 3105364915301217264, 24, (mcodec: 24, size: 32, coder: shake_128hash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( 3351060086830854389, 45622, (mcodec: 45622, size: 54, coder: blake2Bhash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( 3645834793601718007, 45639, (mcodec: 45639, size: 7, coder: blake2Shash)), ( 828423647766066168, 45584, (mcodec: 45584, size: 16, coder: blake2Bhash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), ( -8964267537940339206, 45583, (mcodec: 45583, size: 15, coder: blake2Bhash)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil)), (0, 0, (mcodec: 0, size: 0, coder: nil))], counter: 113)
- Source Edit
MaxHashSize = 128
- Source Edit
MultiHashCodecsList = [0, 17, 86, 18, 19, 23, 22, 21, 20, 24, 25, 26, 27, 28, 29, 45569, 45570, 45571, 45572, 45573, 45574, 45575, 45576, 45577, 45578, 45579, 45580, 45581, 45582, 45583, 45584, 45585, 45586, 45587, 45588, 45589, 45590, 45591, 45592, 45593, 45594, 45595, 45596, 45597, 45598, 45599, 45600, 45601, 45602, 45603, 45604, 45605, 45606, 45607, 45608, 45609, 45610, 45611, 45612, 45613, 45614, 45615, 45616, 45617, 45618, 45619, 45620, 45621, 45622, 45623, 45624, 45625, 45626, 45627, 45628, 45629, 45630, 45631, 45632, 45633, 45634, 45635, 45636, 45637, 45638, 45639, 45640, 45641, 45642, 45643, 45644, 45645, 45646, 45647, 45648, 45649, 45650, 45651, 45652, 45653, 45654, 45655, 45656, 45657, 45658, 45659, 45660, 45661, 45662, 45663, 45664, 52496, 52497]
- Source Edit
Procs
proc `$`(mh: MultiHash): string {....raises: [], tags: [].}
- Return string representation of MultiHash value. Source Edit
proc `==`(a: MultiHash; b: MultiHash): bool {....raises: [], tags: [].}
- Compares MultiHashes a and b, returns true if hashes are equal, false otherwise. Source Edit
proc `==`[T](mdigest: MDigest[T]; mh: MultiHash): bool {.inline, ...raises: [].}
- Compares MultiHash with nimcrypto's MDigest[T], returns true if hashes are equal, false otherwise. Source Edit
proc `==`[T](mh: MultiHash; mdigest: MDigest[T]): bool {....raises: [].}
- Compares MultiHash with nimcrypto's MDigest[T], returns true if hashes are equal, false otherwise. Source Edit
proc base58(value: MultiHash): string {....raises: [], tags: [].}
- Return Base58 encoded string representation of MultiHash value. Source Edit
proc decode(mhtype: typedesc[MultiHash]; data: openArray[byte]; mhash: var MultiHash): MhResult[int] {....raises: [].}
-
Decode MultiHash value from array of bytes data.
On success decoded MultiHash will be stored into mhash and number of bytes consumed will be returned.
On error -1 will be returned.
Source Edit proc digest(mhtype: typedesc[MultiHash]; hashcode: int; data: openArray[byte]): MhResult[ MultiHash] {.inline, ...raises: [].}
- Perform digest calculation using hash algorithm with code hashcode on data array data. Source Edit
proc digest(mhtype: typedesc[MultiHash]; hashname: string; data: openArray[byte]): MhResult[ MultiHash] {.inline, ...raises: [].}
- Perform digest calculation using hash algorithm with name hashname on data array data. Source Edit
proc encode(mbtype: typedesc[MultiBase]; encoding: string; mh: MultiHash): string {. inline, ...raises: [].}
- Get MultiBase encoded representation of mh using encoding encoding. Source Edit
proc hex(value: MultiHash): string {....raises: [], tags: [].}
- Return hexadecimal string representation of MultiHash value. Source Edit
proc init(mhtype: typedesc[MultiHash]; data: openArray[byte]): MhResult[ MultiHash] {.inline, ...raises: [].}
- Create MultiHash from bytes array data. Source Edit
proc init(mhtype: typedesc[MultiHash]; data: string): MhResult[MultiHash] {. inline, ...raises: [].}
- Create MultiHash from hexadecimal string representation data. Source Edit
proc init(mhtype: typedesc[MultiHash]; hashcode: MultiCodec; bdigest: openArray[byte]): MhResult[MultiHash] {.inline, ...raises: [].}
- Create MultiHash from array of bytes bdigest and hash algorithm code hashcode. Source Edit
proc init(mhtype: typedesc[MultiHash]; hashname: string; bdigest: openArray[byte]): MhResult[MultiHash] {.inline, ...raises: [].}
- Create MultiHash from array of bytes bdigest and hash algorithm code hashcode. Source Edit
proc init58(mhtype: typedesc[MultiHash]; data: string): MultiHash {.inline, ...raises: [].}
- Create MultiHash from BASE58 encoded string representation data. Source Edit
proc init[T](mhtype: typedesc[MultiHash]; hashcode: MultiCodec; mdigest: MDigest[T]): MhResult[MultiHash] {.inline, ...raises: [].}
- Create MultiHash from nimcrypto's MDigest and hash algorithm code hashcode. Source Edit
proc init[T](mhtype: typedesc[MultiHash]; hashname: string; mdigest: MDigest[T]): MhResult[ MultiHash] {.inline, ...raises: [].}
- Create MultiHash from nimcrypto's MDigest object and hash algorithm name hashname. Source Edit