nimSHA2
Secure Hash Algorithm - 2, [224, 256, 384, and 512 bits]
Summary
| Latest Version | Unknown |
|---|---|
| License | MIT |
| CI Status | Failing |
| Downloads | 0 |
| Last Indexed | 2026-07-21 05:24 |
Tags
Installation
nimble install nimSHA2
choosenim install nimSHA2
git clone https://github.com/jangko/nimSHA2
OS Compatibility
| Platform | Linux | macOS | Windows | FreeBSD | OpenBSD | NetBSD | Android | iOS | WASM | Embedded |
|---|---|---|---|---|---|---|---|---|---|---|
| nimSHA2 | ✓ | ✓ | ✓ | - | - | - | - | - | - | - |
Source
| Repository | https://github.com/jangko/nimSHA2 |
|---|---|
| Homepage | https://github.com/jangko/nimSHA2 |
| Registry Source | nimble_official |
README
nimSHA2
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