24 lines
497 B
Nim
24 lines
497 B
Nim
import nimcrypto/hash
|
|
import nimcrypto/blake2
|
|
import std/strutils
|
|
|
|
proc main() =
|
|
echo "Testing BLAKE2b hashing..."
|
|
|
|
# Create a simple test string
|
|
let testData = "Hello, NexusOS with BLAKE2b!"
|
|
|
|
# Create a BLAKE2b-512 hash
|
|
var digest = blake2_512.digest(testData)
|
|
|
|
# Convert to hex string for display
|
|
var hexDigest = ""
|
|
for b in digest.data:
|
|
hexDigest.add(b.toHex(2).toLowerAscii())
|
|
|
|
echo "Input: ", testData
|
|
echo "BLAKE2b-512 hash: ", hexDigest
|
|
|
|
when isMainModule:
|
|
main()
|