Sha256: bdb69915fe12a9e0b8f2ab4d72466663b7a3e87e671343a0a623028690f4e452
Contents?: true
Size: 492 Bytes
Versions: 30
Compression:
Stored size: 492 Bytes
Contents
use super::RngSeed; use std::collections::hash_map::DefaultHasher; use std::hash::Hasher; impl RngSeed { /// Generates a seed from the provided byte slice. /// /// # Example /// /// ``` /// # use tokio::runtime::RngSeed; /// let seed = RngSeed::from_bytes(b"make me a seed"); /// ``` pub fn from_bytes(bytes: &[u8]) -> Self { let mut hasher = DefaultHasher::default(); hasher.write(bytes); Self::from_u64(hasher.finish()) } }
Version data entries
30 entries across 30 versions & 1 rubygems