mirror of
https://github.com/aidansteele/sph
synced 2026-01-02 16:14:42 +00:00
No description
| private | ||
| vendor | ||
| .gitmodules | ||
| LICENSE | ||
| README.md | ||
| sph.nim | ||
| sph.nimble | ||
sph
sph is a Nim library for dealing with cryptographic hashes. It is a fairly
thin wrapper of sphlib.
The library can be installed through Nimble: nimble install sph.
The API is as follows:
import sph
var context = SphInit[SHA256]()
SphUpdate(context, "hello ")
SphUpdate(context, "world")
let digest1 = SphFinalize(context)
# convenience wrapper
let digest2 = SphHash[SHA256]("hello world")
check(digest1 == digest2) # assertion passes
The list of available hash functions is:
SHA0SHA1SHA224SHA256SHA384SHA512TigerTiger2MD2MD4MD5RIPEMDRIPEMD128RIPEMD160WhirlpoolWhirlpool0Whirlpool1PanamaRadioGatun32RadioGatun64HAVAL128_3HAVAL128_4HAVAL128_5HAVAL160_3HAVAL160_4HAVAL160_5HAVAL192_3HAVAL192_4HAVAL192_5HAVAL224_3HAVAL224_4HAVAL224_5HAVAL256_3HAVAL256_4HAVAL256_5