No description
Find a file
2018-10-20 09:24:18 +11:00
private Added sphHmac, made macros private, bumped to 0.1.1 2016-05-13 18:29:29 +10:00
vendor Initial commit 2016-05-12 20:17:50 +10:00
.gitmodules Initial commit 2016-05-12 20:17:50 +10:00
LICENSE Added MIT license 2018-10-18 17:28:02 +03:00
README.md Initial commit 2016-05-12 20:17:50 +10:00
sph.nim forgot to export a couple of hash types! 2016-05-13 18:33:02 +10:00
sph.nimble Added sphHmac, made macros private, bumped to 0.1.1 2016-05-13 18:29:29 +10:00

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:

  • SHA0
  • SHA1
  • SHA224
  • SHA256
  • SHA384
  • SHA512
  • Tiger
  • Tiger2
  • MD2
  • MD4
  • MD5
  • RIPEMD
  • RIPEMD128
  • RIPEMD160
  • Whirlpool
  • Whirlpool0
  • Whirlpool1
  • Panama
  • RadioGatun32
  • RadioGatun64
  • HAVAL128_3
  • HAVAL128_4
  • HAVAL128_5
  • HAVAL160_3
  • HAVAL160_4
  • HAVAL160_5
  • HAVAL192_3
  • HAVAL192_4
  • HAVAL192_5
  • HAVAL224_3
  • HAVAL224_4
  • HAVAL224_5
  • HAVAL256_3
  • HAVAL256_4
  • HAVAL256_5