RosettaCodeData/Task/SHA-1/Hare/sha-1.hare
2023-07-01 13:44:08 -04:00

16 lines
296 B
Text

use crypto::sha1;
use encoding::hex;
use fmt;
use hash;
use os;
use strings;
export fn main() void = {
const sha = sha1::sha1();
hash::write(&sha, strings::toutf8("Rosetta Code"));
let sum: [sha1::SIZE]u8 = [0...];
hash::sum(&sha, sum);
hex::encode(os::stdout, sum)!;
fmt::println()!;
};