What is the format returned by hmac's into_bytes()?

⚓ Rust    📅 2025-06-18    👤 surdeus    👁️ 5      

surdeus

Warning

This post was published 58 days ago. The information described in this article may have changed.

I'm implementing something similar to How to set HMAC CSRF token, after the user logs in?

but using the code the crate recommends on their docs. But

HmacSha256::new_from_sliceHmacSha256::new_from_slice(b"my secret and secure key")
    .update(b"a long string")
    .finalize()
    .to_bytes();

i'm left with:

GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>

What is that monstrosity supposed to be?

just instantiating a Hmac::new_from_slice(), i end up with CoreWrapper<HmacCore<CoreWrapper<CtVariableCoreWrapper<Sha256VarCore, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, OidSha256>>>> Manual says it should have been Self :slight_smile:

1 post - 1 participant

Read full topic

🏷️ rust_feed