Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type inference error with sha2 crate #47

Open
l2dy opened this issue Aug 31, 2024 · 0 comments
Open

Type inference error with sha2 crate #47

l2dy opened this issue Aug 31, 2024 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@l2dy
Copy link
Owner

l2dy commented Aug 31, 2024

See https://github.com/dani-garcia/sha2_rustrover for an example.

use sha2::{
    digest::{generic_array::GenericArray, typenum::U32},
    Digest,
};

fn main() {
    let salt = "Hello world!".as_bytes();

    let hash: GenericArray<u8, U32> = sha2::Sha256::new().chain_update(salt).finalize();

    println!("HASH: {hash:?}")
}
@l2dy l2dy added bug Something isn't working help wanted Extra attention is needed labels Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant