3 ms·
> I'm not sure what _specifically_ the issue is here with PartialOrd. I know what a partial order is, I just don't know what partial order maps realize. In Pyt
by Veedrac 11y ago
> I'm not sure what _specifically_ the issue is here with PartialOrd.
I know what a partial order is, I just don't know what partial order maps realize. In Python they aren't orderable.
> ChaChaRng _does_ mention OsRng
It says to use OsRng if cryptographic security is needed, not how to seed with it.
The obvious way is something like
let osrng = OsRng::new().unwrap();
let mut key = [0u32; 8];
for word in key.iter_mut() {
*word = osrng.gen();
}
let prng = ChaChaRng::from_seed(&key[..])
which is a pain.
- steveklabnik 11y agoRoger, I see what you're saying, on both counts. Thank you for taking the time to spell it out to me.
- dbaupp 11y agoMaps can be compared lexicographically. BTreeMap and VecMap have a canonical order in which they store their elements so iter::order::cmp(self.iter(), other.iter()) works as an ordering. HashMap in Rust (dict in Python) doesn't have a canonical ordering of elements, so this doesn't make sense.