sph
Nim wrapper for sphlib
Summary
| Latest Version | 0.1.1 |
|---|---|
| License | MIT |
| CI Status | Failing |
| Downloads | 0 |
| Last Indexed | 2026-08-31 07:15 |
Tags
Authors
- Aidan Steele
Installation
nimble install sph
choosenim install sph
git clone https://github.com/aidansteele/sph
OS Compatibility
| Platform | Linux | macOS | Windows | FreeBSD | OpenBSD | NetBSD | Android | iOS | WASM | Embedded |
|---|---|---|---|---|---|---|---|---|---|---|
| sph | ✓ | ✓ | ✓ | - | - | - | - | - | - | - |
Dependencies
| Package | Version | Optional |
|---|---|---|
| nim >= | 0.13.1 | No |
Source
| Repository | https://github.com/aidansteele/sph |
|---|---|
| Homepage | https://github.com/aidansteele/sph |
| Registry Source | nimble_official |
README
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