RosettaCodeData/Task/SHA-1/Hare/sha-1.hare

17 lines
308 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
use crypto::sha1;
use encoding::hex;
use fmt;
use hash;
use os;
use strings;
export fn main() void = {
2025-08-11 18:05:26 -07:00
const sha = sha1::sha1();
hash::write(&sha, strings::toutf8("Rosetta Code"));
2023-07-01 11:58:00 -04:00
2025-08-11 18:05:26 -07:00
let sum: [sha1::SIZE]u8 = [0...];
hash::sum(&sha, sum);
hex::encode(os::stdout, sum)!;
fmt::println()!;
2023-07-01 11:58:00 -04:00
};