ggstd 0.1.0

Partial implementation of Go standard library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Copyright 2023 The rust-ggstd authors.
// SPDX-License-Identifier: 0BSD

use ggstd::crypto::sha256;
use ggstd::encoding::hex;

fn main() {
    let msg = "hello world";
    let hash = sha256::sum256(msg.as_bytes());
    println!("message:     {}", msg);
    println!("sha256 hash: {}", hex::encode_to_string(&hash));

    let hash = sha256::sum224(msg.as_bytes());
    println!("sha224 hash: {}", hex::encode_to_string(&hash));
}