Hey all, and happy new year!
I'm writing a program for embedded systems that needs to seed an HC-128 random number generator. I'm generating a seed from the hardware, but this breaks:
Hc128Rng::from_seed needs a
[u8; 32], but I'm passing in an
[u8]. What confuses me is I don't see how either of these are "distinct" types. They're exactly the same; the only difference is that one has an explicit length in its definition and the other doesn't. But both are slices. My random seed generation gave me
[u8; 8] from
u64::to_ne_bytes. This also fails:
What is the "correct" and "idiomatic" way of converting
[T] slices to
[T; n] and vice-versa?