Home

Awesome

Hashlib

Hashlib contains almost all the hash functions for Nim and provides uniform interface, hmac, and benchmark for all hashes. The C source codes are collected from RHash, MHash, Sphlib, Team Keccak, BLAKE2, BLAKE3, tiny_sha3, xxHash etc. This module also provides the same interface for libgcrypt, nimcrypto, and Nim builtin MD5/SHA1.

Install

nimble install hashlib

For Linux user:

sudo apt install libgcrypt20 libgcrypt20-dev

This module already includes libgcrypt for Windows (mingw32/64 only).

Usage

How to Import

Hash functions can be imported all-in-one or one-by-one.

import hashlib # import all available hashes
import hashlib/rhash # import all hashes from RHash
import hashlib/mhash # import all hashes from MHash
import hashlib/sph # import all hashes from Sphlib
import hashlib/gcrypt # import all hashes from libgcrypt
import hashlib/misc # import other hashes
import hashlib/lean # import commonly used hashes
import hashlib/bench # import runBench() template
import hashlib/rhash/[aich, crc32, ed2k, edonr, gost, has160, md4, md5, ripemd160, sha1, sha256, sha3, sha512, snefru, streebog, tiger, tth]
import hashlib/mhash/[adler32, crc32, gost, haval, md2, md4, md5, ripemd, sha1, sha256, sha512, snefru, tiger, whirlpool]
import hashlib/sph/[blake, bmw, cubehash, echohash, fugue, groestl, hamsi, haval, jh, keccak, luffa, md2, md4, md5, panama, radiogatun, ripemd, sha0, sha1, sha256, sha512, shabal, shavite, simd, skein, tiger, whirlpool]
import hashlib/misc/[blake2, blake3, crypto, kangarootwelve, nimhash, sha3, tinysha3, tinyshabal, xxhash]

Use import ... as ... to avoid name conflict. For example:

import hashlib/rhash/md5 as rhash_md5
import hashlib/mhash/md5 as mhash_md5
import hashlib/bench

runBench()

Simple API

count[HashType](DataTypes): HashType
count[HashType](DataTypes, DigestTypes)

DataTypes = string | openarray[byte] | openarray[char] | Stream | MemoryBlock
DigestTypes = HashType | Digest | openarray[byte] | openarray[char]

Stream API

init[HashType](): Context[HashType]
init(var Context[HashType])

update(var Context[HashType], DataTypes)

final(var Context[HashType]): HashType
final(var Context[HashType], var DigestTypes)

DataTypes = string | openarray[byte] | openarray[char] | Stream | MemoryBlock
DigestTypes = HashType | Digest | openarray[byte] | openarray[char]

Simple HMAC API

count[Hmac[HashType]](KeyTypes, DataTypes): HashType
count[Hmac[HashType]](KeyTypes, DataTypes, var DigestTypes)

KeyTypes = string | openarray[byte] | openarray[char] | MemoryBlock
DataTypes = string | openarray[byte] | openarray[char] | Stream | MemoryBlock
DigestTypes = HashType | Digest | openarray[byte] | openarray[char]

Stream HMAC API

init[Hmac[HashType]](KeyTypes): Hmac[HashType]
init(var Hmac[HashType], KeyTypes)

update(var Hmac[HashType], DataTypes)

final(var Hmac[HashType]): HashType
final(var Hmac[HashType], var DigestTypes)

KeyTypes = string | openarray[byte] | openarray[char] | MemoryBlock
DataTypes = string | openarray[byte] | openarray[char] | Stream | MemoryBlock
DigestTypes = HashType | Digest | openarray[byte] | openarray[char]

Example

import hashlib/rhash/md5

# Now we have RHASH_MD5
doAssert(declared(RHASH_MD5))
doAssert(RHASH_MD5 is HashType)

# Gets information from HashType
doAssert(RHASH_MD5.digestSize == 16)
doAssert(RHASH_MD5.blockSize == 64)

# Counts the hash for empty string, returns a RHASH_MD5 object
var hash = count[RHASH_MD5]("")
doAssert(hash.type is RHASH_MD5)

# hash.data should be array[16, byte]
doAssert(hash.data == [byte 212, 29, 140, 217, 143, 0, 178, 4, 233, 128, 9, 152, 236, 248, 66, 126])

# `$` convert HashType to string
doAssert($hash == "d41d8cd98f00b204e9800998ecf8427e")

# Result can store in Digest object.
var digest: Digest
count[RHASH_MD5]("", digest)

# digest.data should be seq[byte] in length of RHASH_MD5.digestSize
doAssert(digest.data == @[byte 212, 29, 140, 217, 143, 0, 178, 4, 233, 128, 9, 152, 236, 248, 66, 126])

# `$` convert Digest object to string
doAssert($hash == "d41d8cd98f00b204e9800998ecf8427e")

# Try another input data type: openarray[char]
doAssert($count[RHASH_MD5](toOpenArray("abc", 0, 2)) == "900150983cd24fb0d6963f7d28e17f72")

# Try another ouptut data type: openarray[byte]
var digestSeq = newSeq[byte](16)
count[RHASH_MD5]("abc", digestSeq)
doAssert(digestSeq == @[byte 144, 1, 80, 152, 60, 210, 79, 176, 214, 150, 63, 125, 40, 225, 127, 114])

import strutils
import hashlib/misc/sha3

# Now we have SHAKE128, it support extendable-output functions (XOFs)
doAssert(declared(SHAKE128))
doAssert(SHAKE128.xof == true)

# Gets 1024 bytes output, use initDigest()
digest = initDigest(1024)
count[SHAKE128]("", digest)
doAssert(($digest).startsWith("7f9c2ba4e88f827d616045507605853e"))

# Gets 2048 bytes output, use setLen()
digest.setLen(2048)
count[SHAKE128]("", digest)
doAssert(($digest).endsWith("10e7e33816e581d85fc48a77254c23bb"))

# Try stream API
var ctx = init[RHASH_MD5]()
ctx.update("")
doAssert($ctx.final() == "d41d8cd98f00b204e9800998ecf8427e")

# Reuses the ctx and stores result in digest object
doAssert(ctx.type is Context[RHASH_MD5])
ctx.init()
ctx.update("")
ctx.final(digest)
doAssert($digest == "d41d8cd98f00b204e9800998ecf8427e")

# Try simple HMAC API
doAssert($count[Hmac[RHASH_MD5]]("key", "data") == "9d5c73ef85594d34ec4438b7c97e51d8")

# Try stream HMAC API
var hmac = init[Hmac[RHASH_MD5]]("key")
hmac.update("data")
doAssert($hmac.final() == "9d5c73ef85594d34ec4438b7c97e51d8")

# Reuses the HMAC ctx and stores result in digest object
doAssert(hmac.type is Hmac[RHASH_MD5])
hmac.init("key")
hmac.update("data")
hmac.final(digest)
doAssert($digest == "9d5c73ef85594d34ec4438b7c97e51d8")

import hashlib/bench

# Now we have runBench template
doAssert(declared(runBench))

# Runs benchmark for all available hashes: RHASH_MD5, KECCAKnnn, SHA3_nnn, SHAKEnnn, etc
runBench()

# Runs benchmark for MD5 only
runBench("MD5")

# Runs benchmark for SHA3 and SHAKE
runBench do (name: string) -> bool:
  name.startsWith("SHA3") or name.startsWith("SHAKE")

Available Hashes

<details> <summary>Details</summary>
ModuleSubmoduleHashes
rhashaichRHASH_AICH
rhashcrc32RHASH_CRC32, RHASH_CRC32C
rhashed2kRHASH_ED2K
rhashedonrRHASH_EDONR224, RHASH_EDONR256, RHASH_EDONR384, RHASH_EDONR512
rhashgostRHASH_GOST94, RHASH_GOST94PRO
rhashhas160RHASH_HAS160
rhashmd4RHASH_MD4
rhashmd5RHASH_MD5
rhashripemdRHASH_RIPEMD160
rhashsha1RHASH_SHA1
rhashsha256RHASH_SHA224, RHASH_SHA256
rhashsha512RHASH_SHA384, RHASH_SHA512
rhashsha3 or keccakRHASH_KECCAK224, RHASH_KECCAK256, RHASH_KECCAK384, RHASH_KECCAK512, RHASH_SHA3_224, RHASH_SHA3_256, RHASH_SHA3_384, RHASH_SHA3_512
rhashsnefruRHASH_SNEFRU128, RHASH_SNEFRU256
rhashstreebogRHASH_GOST2012_256, RHASH_GOST2012_512, RHASH_STREEBOG256, RHASH_STREEBOG512
rhashtigerRHASH_TIGER
rhashtthRHASH_TTH
mhashadler32MHASH_ADLER32
mhashcrc32MHASH_CRC32, MHASH_CRC32B
mhashgostMHASH_GOST
mhashhavalMHASH_HAVAL128_3, MHASH_HAVAL128_4, MHASH_HAVAL128_5, MHASH_HAVAL160_3, MHASH_HAVAL160_4, MHASH_HAVAL160_5, MHASH_HAVAL192_3, MHASH_HAVAL192_4, MHASH_HAVAL192_5, MHASH_HAVAL224_3, MHASH_HAVAL224_4, MHASH_HAVAL224_5, MHASH_HAVAL256_3, MHASH_HAVAL256_4, MHASH_HAVAL256_5
mhashmd2MHASH_MD2
mhashmd4MHASH_MD4
mhashmd5MHASH_MD5
mhashripemdMHASH_RIPEMD128, MHASH_RIPEMD160, MHASH_RIPEMD256, MHASH_RIPEMD320
mhashsha1MHASH_SHA1
mhashsha256MHASH_SHA224, MHASH_SHA256
mhashsha512MHASH_SHA384, MHASH_SHA512
mhashsnefruMHASH_SNEFRU128, MHASH_SNEFRU256
mhashtigerMHASH_TIGER, MHASH_TIGER128, MHASH_TIGER160
mhashwhirlpoolMHASH_WHIRLPOOL
sphblakeSPH_BLAKE224, SPH_BLAKE256, SPH_BLAKE384, SPH_BLAKE512
sphbmwSPH_BMW224, SPH_BMW256, SPH_BMW384, SPH_BMW512
sphcubehashSPH_CUBEHASH224, SPH_CUBEHASH256, SPH_CUBEHASH384, SPH_CUBEHASH512
sphechohashSPH_ECHO224, SPH_ECHO256, SPH_ECHO384, SPH_ECHO512
sphfugueSPH_FUGUE224, SPH_FUGUE256, SPH_FUGUE384, SPH_FUGUE512
sphgroestlSPH_GROESTL224, SPH_GROESTL256, SPH_GROESTL384, SPH_GROESTL512
sphhamsiSPH_HAMSI224, SPH_HAMSI256, SPH_HAMSI384, SPH_HAMSI512
sphhavalSPH_HAVAL128_3, SPH_HAVAL128_4, SPH_HAVAL128_5, SPH_HAVAL160_3, SPH_HAVAL160_4, SPH_HAVAL160_5, SPH_HAVAL192_3, SPH_HAVAL192_4, SPH_HAVAL192_5, SPH_HAVAL224_3, SPH_HAVAL224_4, SPH_HAVAL224_5, SPH_HAVAL256_3, SPH_HAVAL256_4, SPH_HAVAL256_5
sphjhSPH_JH224, SPH_JH256, SPH_JH384, SPH_JH512
sphluffaSPH_LUFFA224, SPH_LUFFA256, SPH_LUFFA384, SPH_LUFFA512
sphmd2SPH_MD2
sphmd4SPH_MD4
sphmd5SPH_MD5
sphpanamaSPH_PANAMA
sphradiogatunSPH_RADIOGATUN32, SPH_RADIOGATUN64
sphripemdSPH_RIPEMD, SPH_RIPEMD128, SPH_RIPEMD160
sphsha0SPH_SHA0
sphsha1SPH_SHA1
sphsha256SPH_SHA224, SPH_SHA256
sphsha512SPH_SHA384, SPH_SHA512
sphsha3 or keccakSPH_KECCAK224, SPH_KECCAK256, SPH_KECCAK384, SPH_KECCAK512, SPH_SHA3_224, SPH_SHA3_256, SPH_SHA3_384, SPH_SHA3_512
sphshabalSPH_SHABAL192, SPH_SHABAL224, SPH_SHABAL256, SPH_SHABAL384, SPH_SHABAL512
sphshaviteSPH_SHAVITE224, SPH_SHAVITE256, SPH_SHAVITE384, SPH_SHAVITE512
sphsimdSPH_SIMD224, SPH_SIMD256, SPH_SIMD384, SPH_SIMD512
sphskeinSPH_SKEIN224, SPH_SKEIN256, SPH_SKEIN384, SPH_SKEIN512
sphtigerSPH_TIGER, SPH_TIGER2
sphwhirlpoolSPH_WHIRLPOOL, SPH_WHIRLPOOL0, SPH_WHIRLPOOL1
miscblake2BLAKE2S_224, BLAKE2S_256, BLAKE2B_384, BLAKE2B_512
miscblake3BLAKE3, BLAKE3_128, BLAKE3_160, BLAKE3_192, BLAKE3_224, BLAKE3_256, BLAKE3_384, BLAKE3_512
misccryptoNIMCRYPTO_SHA1, NIMCRYPTO_SHA224, NIMCRYPTO_SHA256, NIMCRYPTO_SHA384, NIMCRYPTO_SHA512, NIMCRYPTO_SHA512_224, NIMCRYPTO_SHA512_256, NIMCRYPTO_RIPEMD128, NIMCRYPTO_RIPEMD160, NIMCRYPTO_RIPEMD256, NIMCRYPTO_RIPEMD320, NIMCRYPTO_BLAKE2S_224, NIMCRYPTO_BLAKE2S_256, NIMCRYPTO_BLAKE2B_384, NIMCRYPTO_BLAKE2B_512, NIMCRYPTO_KECCAK224, NIMCRYPTO_KECCAK256, NIMCRYPTO_KECCAK384, NIMCRYPTO_KECCAK512, NIMCRYPTO_SHA3_224, NIMCRYPTO_SHA3_256, NIMCRYPTO_SHA3_384, NIMCRYPTO_SHA3_512, NIMCRYPTO_SHAKE128, NIMCRYPTO_SHAKE256
misckangarootwelveKANGAROO_TWELVE
miscnimhashNIM_MD5, NIM_SHA1
miscsha3KECCAK224, KECCAK256, KECCAK384, KECCAK512, SHA3_224, SHA3_256, SHA3_384, SHA3_512, SHAKE128, SHAKE256
misctinysha3TINY_SHA3_224, TINY_SHA3_256, TINY_SHA3_384, TINY_SHA3_512, TINY_SHAKE128, TINY_SHAKE256
misctinyshabalTINY_SHABAL192, TINY_SHABAL224, TINY_SHABAL256, TINY_SHABAL384, TINY_SHABAL512
miscxxhashXXHASH32, XXHASH64, XXHASH3_64, XXHASH3_128
ModuleHashes
gcryptGCRYPT_BLAKE2S_128, GCRYPT_BLAKE2S_160, GCRYPT_BLAKE2S_224, GCRYPT_BLAKE2S_256, GCRYPT_BLAKE2B_160, GCRYPT_BLAKE2B_256, GCRYPT_BLAKE2B_384, GCRYPT_BLAKE2B_512, GCRYPT_CRC32, GCRYPT_CRC32_RFC1510, GCRYPT_CRC24_RFC2440, GCRYPT_GOST, GCRYPT_GOSTPRO, GCRYPT_MD4, GCRYPT_MD5, GCRYPT_RIPEMD160, GCRYPT_SHA1, GCRYPT_SHA512, GCRYPT_SHA224, GCRYPT_SHA256, GCRYPT_SHA384, GCRYPT_SHA3_224, GCRYPT_SHA3_256, GCRYPT_SHA3_384, GCRYPT_SHA3_512, GCRYPT_STREEBOG256, GCRYPT_STREEBOG512, GCRYPT_GOST2012_256, GCRYPT_GOST2012_512, GCRYPT_TIGER, GCRYPT_TIGER1, GCRYPT_TIGER2, GCRYPT_WHIRLPOOL, GCRYPT_SHAKE128, GCRYPT_SHAKE256
leanRHASH_CRC32, RHASH_CRC32C, RHASH_MD5, RHASH_SHA1, RHASH_SHA224, RHASH_SHA256, KECCAK224, KECCAK256, KECCAK384, KECCAK512, SHA3_224, SHA3_256, SHA3_384, SHA3_512, SHAKE128, SHAKE256, XXHASH32, XXHASH64, XXHASH3_64, XXHASH3_128
</details>

Benchmark

Intel Core i7-8700, 16G DDR4 SDRAM
Nim Compiler Version 1.2.0 [Windows: amd64]
gcc version 10.1.0 (Rev2, Built by MSYS2 project)

nimble all_bench

<details> <summary>Details</summary>
NameSpeed
MEMORY_COPY12832.029 MB/s
GCRYPT_BLAKE2S_128622.712 MB/s
GCRYPT_BLAKE2S_160628.243 MB/s
GCRYPT_BLAKE2S_224628.358 MB/s
GCRYPT_BLAKE2S_256628.334 MB/s
GCRYPT_BLAKE2B_1601020.794 MB/s
GCRYPT_BLAKE2B_2561019.898 MB/s
GCRYPT_BLAKE2B_3841020.346 MB/s
GCRYPT_BLAKE2B_5121020.616 MB/s
GCRYPT_CRC3216846.361 MB/s
GCRYPT_CRC32_RFC151017717.931 MB/s
GCRYPT_CRC24_RFC244016412.276 MB/s
GCRYPT_GOST57.804 MB/s
GCRYPT_GOSTPRO57.153 MB/s
GCRYPT_MD41379.786 MB/s
GCRYPT_MD5780.110 MB/s
GCRYPT_RIPEMD160494.910 MB/s
GCRYPT_SHA11104.924 MB/s
GCRYPT_SHA512695.154 MB/s
GCRYPT_SHA224481.515 MB/s
GCRYPT_SHA256481.793 MB/s
GCRYPT_SHA384695.957 MB/s
GCRYPT_SHA3_224501.060 MB/s
GCRYPT_SHA3_256471.950 MB/s
GCRYPT_SHA3_384361.849 MB/s
GCRYPT_SHA3_512252.960 MB/s
GCRYPT_STREEBOG256142.061 MB/s
GCRYPT_STREEBOG512142.253 MB/s
GCRYPT_GOST2012_256142.001 MB/s
GCRYPT_GOST2012_512141.977 MB/s
GCRYPT_TIGER740.735 MB/s
GCRYPT_TIGER1740.593 MB/s
GCRYPT_TIGER2741.207 MB/s
GCRYPT_WHIRLPOOL292.381 MB/s
GCRYPT_SHAKE128581.304 MB/s
GCRYPT_SHAKE256472.293 MB/s
MHASH_ADLER32744.585 MB/s
MHASH_CRC32448.916 MB/s
MHASH_CRC32B501.668 MB/s
MHASH_GOST76.759 MB/s
MHASH_HAVAL128_3900.552 MB/s
MHASH_HAVAL128_4606.619 MB/s
MHASH_HAVAL128_5505.628 MB/s
MHASH_HAVAL160_3888.439 MB/s
MHASH_HAVAL160_4607.024 MB/s
MHASH_HAVAL160_5507.189 MB/s
MHASH_HAVAL192_3898.771 MB/s
MHASH_HAVAL192_4607.135 MB/s
MHASH_HAVAL192_5507.097 MB/s
MHASH_HAVAL224_3901.965 MB/s
MHASH_HAVAL224_4606.208 MB/s
MHASH_HAVAL224_5504.195 MB/s
MHASH_HAVAL256_3901.136 MB/s
MHASH_HAVAL256_4607.437 MB/s
MHASH_HAVAL256_5507.259 MB/s
MHASH_MD212.578 MB/s
MHASH_MD41213.312 MB/s
MHASH_MD5742.038 MB/s
MHASH_RIPEMD128675.256 MB/s
MHASH_RIPEMD160409.326 MB/s
MHASH_RIPEMD256579.539 MB/s
MHASH_RIPEMD320379.713 MB/s
MHASH_SHA1693.308 MB/s
MHASH_SHA224212.474 MB/s
MHASH_SHA256213.506 MB/s
MHASH_SHA384338.561 MB/s
MHASH_SHA512338.696 MB/s
MHASH_SNEFRU12847.306 MB/s
MHASH_SNEFRU25631.432 MB/s
MHASH_TIGER726.406 MB/s
MHASH_TIGER128728.247 MB/s
MHASH_TIGER160728.513 MB/s
MHASH_WHIRLPOOL179.830 MB/s
RHASH_SHA1207.189 MB/s
RHASH_AICH206.913 MB/s
RHASH_CRC322171.034 MB/s
RHASH_CRC32C10251.153 MB/s
RHASH_MD41321.196 MB/s
RHASH_ED2K1321.737 MB/s
RHASH_EDONR224995.827 MB/s
RHASH_EDONR256996.393 MB/s
RHASH_EDONR3842076.196 MB/s
RHASH_EDONR5122077.447 MB/s
RHASH_GOST9476.811 MB/s
RHASH_GOST94PRO76.974 MB/s
RHASH_HAS160995.907 MB/s
RHASH_MD5775.116 MB/s
RHASH_RIPEMD160329.032 MB/s
RHASH_SHA224272.976 MB/s
RHASH_SHA256273.380 MB/s
RHASH_KECCAK224335.654 MB/s
RHASH_KECCAK256317.188 MB/s
RHASH_KECCAK384242.849 MB/s
RHASH_KECCAK512168.696 MB/s
RHASH_SHA3_224335.662 MB/s
RHASH_SHA3_256317.003 MB/s
RHASH_SHA3_384242.940 MB/s
RHASH_SHA3_512168.896 MB/s
RHASH_SHA384471.274 MB/s
RHASH_SHA512471.251 MB/s
RHASH_SNEFRU12855.563 MB/s
RHASH_SNEFRU25636.936 MB/s
RHASH_GOST2012_256141.778 MB/s
RHASH_GOST2012_512141.898 MB/s
RHASH_STREEBOG256141.774 MB/s
RHASH_STREEBOG512141.613 MB/s
RHASH_TIGER770.185 MB/s
RHASH_TTH645.682 MB/s
SPH_BLAKE224395.869 MB/s
SPH_BLAKE256394.580 MB/s
SPH_BLAKE384663.768 MB/s
SPH_BLAKE512666.236 MB/s
SPH_BMW224526.252 MB/s
SPH_BMW256522.171 MB/s
SPH_BMW3841136.260 MB/s
SPH_BMW5121138.667 MB/s
SPH_CUBEHASH224170.440 MB/s
SPH_CUBEHASH256170.267 MB/s
SPH_CUBEHASH384170.451 MB/s
SPH_CUBEHASH512170.312 MB/s
SPH_ECHO224170.155 MB/s
SPH_ECHO256170.220 MB/s
SPH_ECHO38486.824 MB/s
SPH_ECHO51287.691 MB/s
SPH_FUGUE224171.141 MB/s
SPH_FUGUE256170.973 MB/s
SPH_FUGUE384113.776 MB/s
SPH_FUGUE51286.328 MB/s
SPH_GROESTL224166.418 MB/s
SPH_GROESTL256165.883 MB/s
SPH_GROESTL384108.884 MB/s
SPH_GROESTL512108.750 MB/s
SPH_HAMSI22489.133 MB/s
SPH_HAMSI25689.579 MB/s
SPH_HAMSI38429.249 MB/s
SPH_HAMSI51229.390 MB/s
SPH_HAVAL128_3877.055 MB/s
SPH_HAVAL128_4587.741 MB/s
SPH_HAVAL128_5498.497 MB/s
SPH_HAVAL160_3887.406 MB/s
SPH_HAVAL160_4591.072 MB/s
SPH_HAVAL160_5499.323 MB/s
SPH_HAVAL192_3893.527 MB/s
SPH_HAVAL192_4592.814 MB/s
SPH_HAVAL192_5501.283 MB/s
SPH_HAVAL224_3893.655 MB/s
SPH_HAVAL224_4593.197 MB/s
SPH_HAVAL224_5501.276 MB/s
SPH_HAVAL256_3893.687 MB/s
SPH_HAVAL256_4593.268 MB/s
SPH_HAVAL256_5501.143 MB/s
SPH_JH22492.835 MB/s
SPH_JH25693.233 MB/s
SPH_JH38493.239 MB/s
SPH_JH51292.855 MB/s
SPH_KECCAK224341.654 MB/s
SPH_KECCAK256322.773 MB/s
SPH_KECCAK384247.248 MB/s
SPH_KECCAK512173.630 MB/s
SPH_SHA3_224340.566 MB/s
SPH_SHA3_256321.794 MB/s
SPH_SHA3_384246.112 MB/s
SPH_SHA3_512173.703 MB/s
SPH_LUFFA224222.853 MB/s
SPH_LUFFA256223.132 MB/s
SPH_LUFFA384167.544 MB/s
SPH_LUFFA512124.650 MB/s
SPH_MD28.493 MB/s
SPH_MD41321.737 MB/s
SPH_MD5771.772 MB/s
SPH_PANAMA1858.874 MB/s
SPH_RADIOGATUN32689.394 MB/s
SPH_RADIOGATUN641367.035 MB/s
SPH_RIPEMD651.954 MB/s
SPH_RIPEMD128497.574 MB/s
SPH_RIPEMD160326.583 MB/s
SPH_SHA0761.076 MB/s
SPH_SHA1687.782 MB/s
SPH_SHA224262.055 MB/s
SPH_SHA256261.094 MB/s
SPH_SHA384500.553 MB/s
SPH_SHA512500.616 MB/s
SPH_SHABAL192718.716 MB/s
SPH_SHABAL224720.440 MB/s
SPH_SHABAL256716.055 MB/s
SPH_SHABAL384716.779 MB/s
SPH_SHABAL512720.918 MB/s
SPH_SHAVITE224286.701 MB/s
SPH_SHAVITE256287.189 MB/s
SPH_SHAVITE384178.625 MB/s
SPH_SHAVITE512179.425 MB/s
SPH_SIMD224154.389 MB/s
SPH_SIMD256154.313 MB/s
SPH_SIMD384135.536 MB/s
SPH_SIMD512135.496 MB/s
SPH_SKEIN224731.481 MB/s
SPH_SKEIN256731.791 MB/s
SPH_SKEIN384731.984 MB/s
SPH_SKEIN512732.011 MB/s
SPH_TIGER723.458 MB/s
SPH_TIGER2719.730 MB/s
SPH_WHIRLPOOL191.595 MB/s
SPH_WHIRLPOOL0190.070 MB/s
SPH_WHIRLPOOL1191.610 MB/s
BLAKE2S_224784.142 MB/s
BLAKE2S_256783.496 MB/s
BLAKE2B_3841030.577 MB/s
BLAKE2B_5121045.555 MB/s
BLAKE33161.655 MB/s
BLAKE3_1283205.950 MB/s
BLAKE3_1603221.442 MB/s
BLAKE3_1923257.223 MB/s
BLAKE3_2243230.287 MB/s
BLAKE3_2563249.074 MB/s
BLAKE3_3843234.153 MB/s
BLAKE3_5123243.173 MB/s
NIMCRYPTO_SHA1642.170 MB/s
NIMCRYPTO_SHA224268.603 MB/s
NIMCRYPTO_SHA256268.705 MB/s
NIMCRYPTO_SHA384417.258 MB/s
NIMCRYPTO_SHA512419.078 MB/s
NIMCRYPTO_SHA512_224418.683 MB/s
NIMCRYPTO_SHA512_256417.519 MB/s
NIMCRYPTO_RIPEMD128483.505 MB/s
NIMCRYPTO_RIPEMD160318.973 MB/s
NIMCRYPTO_RIPEMD256561.877 MB/s
NIMCRYPTO_RIPEMD320372.492 MB/s
NIMCRYPTO_BLAKE2S_224208.432 MB/s
NIMCRYPTO_BLAKE2S_256208.728 MB/s
NIMCRYPTO_BLAKE2B_384291.281 MB/s
NIMCRYPTO_BLAKE2B_512292.888 MB/s
NIMCRYPTO_KECCAK224154.401 MB/s
NIMCRYPTO_KECCAK256146.087 MB/s
NIMCRYPTO_KECCAK384115.611 MB/s
NIMCRYPTO_KECCAK51281.163 MB/s
NIMCRYPTO_SHA3_224149.955 MB/s
NIMCRYPTO_SHA3_256146.956 MB/s
NIMCRYPTO_SHA3_384113.737 MB/s
NIMCRYPTO_SHA3_51282.342 MB/s
NIMCRYPTO_SHAKE128175.793 MB/s
NIMCRYPTO_SHAKE256146.929 MB/s
KANGAROO_TWELVE786.040 MB/s
NIM_MD5578.182 MB/s
NIM_SHA1547.798 MB/s
KECCAK224358.977 MB/s
KECCAK256339.643 MB/s
KECCAK384260.442 MB/s
KECCAK512180.880 MB/s
SHA3_224359.340 MB/s
SHA3_256339.156 MB/s
SHA3_384260.399 MB/s
SHA3_512181.007 MB/s
SHAKE128419.043 MB/s
SHAKE256338.786 MB/s
TINY_SHA3_224155.440 MB/s
TINY_SHA3_256147.113 MB/s
TINY_SHA3_384106.315 MB/s
TINY_SHA3_51282.133 MB/s
TINY_SHAKE128179.626 MB/s
TINY_SHAKE256148.236 MB/s
TINY_SHABAL192493.854 MB/s
TINY_SHABAL224495.005 MB/s
TINY_SHABAL256494.428 MB/s
TINY_SHABAL384495.282 MB/s
TINY_SHABAL512495.133 MB/s
XXHASH327688.759 MB/s
XXHASH6413670.540 MB/s
XXHASH3_6420712.510 MB/s
XXHASH3_12821376.657 MB/s
</details>

License

Library and Source Codes

ProjectLicense
RHashBSD Zero Clause License
MHashGNU Lesser GPL
SphlibMIT-like, BSD-like
XKCPTeam Keccak XKCP License
BLAKE2CC0
BLAKE3CC0 1.0
tiny_sha3MIT License
xxHashBSD 2-Clause
libgcryptLGPLv2.1+

Hashlib

Read license.txt for more details. Copyright (c) 2020 Kai-Hung Chen, Ward. All rights reserved.