No description
Find a file
2021-09-09 14:08:27 +07:00
.github/workflows ci: fixes mingw download url and csources url 2021-09-09 14:08:27 +07:00
doc add github action script 2021-01-23 15:02:30 +07:00
tests Update with openarray[char|byte], array[N, uint8] in outputs 2021-09-09 13:53:21 +07:00
.gitattributes initial commit 2015-08-28 22:26:00 +07:00
.gitignore update git ignore 2016-01-30 19:57:05 +07:00
LICENSE Added MIT license 2018-10-18 17:05:10 +03:00
nimSHA2.nim Update with openarray[char|byte], array[N, uint8] in outputs 2021-09-09 13:53:21 +07:00
nimSHA2.nimble add github action script 2021-01-23 15:02:30 +07:00
readme.md add github action script 2021-01-23 15:02:30 +07:00

nimSHA2

Github action

Secure Hash Algorithm 2

224, 256, 384, and 512 bits

initially this was part of nimPDF project, then I decided to release it separately

example:

var sha = initSHA[SHA256]()
sha.update("test SHA256")
let digest = sha.final()

or:

let digest = computeSHA256("test SHA256")

conversion:

  • to convert digest into string, use proc $
  • to convert digest into hex string, use toHex

each version of SHA2 hash function will produce output according to it's name: SHA224 produce 224 bits hash, SHA256 produce 256 bits hash, and so on

already tested with test vector from here, see tests/test.nim