### get_word_pos Source: https://docs.rs/rand_chacha/0.10.0/rand_chacha/type.ChaChaRng.html Retrieves the current offset from the start of the stream in 32-bit words. ```APIDOC ## pub fn get_word_pos(&self) -> u128 ### Description Returns the offset from the start of the stream, measured in 32-bit words. Since the generator uses 16-word blocks, the result is a 68-bit number. ``` -------------------------------- ### set_word_pos Source: https://docs.rs/rand_chacha/0.10.0/rand_chacha/type.ChaChaRng.html Sets the current offset from the start of the stream in 32-bit words. ```APIDOC ## pub fn set_word_pos(&mut self, word_offset: u128) ### Description Sets the internal counter offset to the specified 32-bit word position. ``` -------------------------------- ### ChaCha20Core Initialization Source: https://docs.rs/rand_chacha/0.10.0/rand_chacha/struct.ChaCha20Core.html Methods for creating a new instance of ChaCha20Core using different seeding strategies. ```APIDOC ## SeedableRng::from_seed ### Description Create a new PRNG using the given 32-byte seed. ### Signature `fn from_seed(seed: [u8; 32]) -> Self` ## SeedableRng::seed_from_u64 ### Description Create a new PRNG using a u64 seed. ### Signature `fn seed_from_u64(state: u64) -> Self` ``` -------------------------------- ### Generate Random Values Source: https://docs.rs/rand_chacha/0.10.0/rand_chacha/index.html Initialize a ChaCha12Rng with a default seed and generate a random u64 value. ```rust use rand_core::{SeedableRng, Rng}; use rand_chacha::ChaCha12Rng; let mut rng = ChaCha12Rng::from_seed(Default::default()); let x = rng.next_u64(); assert_eq!(x, 0x53f955076a9af49b); ``` -------------------------------- ### ChaCha20Core Generation Source: https://docs.rs/rand_chacha/0.10.0/rand_chacha/struct.ChaCha20Core.html Methods for generating random data blocks using the ChaCha20 core. ```APIDOC ## Generator::generate ### Description Generate a new block of output data. ### Signature `fn generate(&mut self, output: &mut [u32; 64])` ``` -------------------------------- ### Seed ChaCha12Rng from OS Source: https://docs.rs/rand_chacha/0.10.0/rand_chacha/index.html Construct a ChaCha12Rng instance using the system's random number generator as a seed source. ```rust let rng = ChaCha12Rng::try_from_rng(&mut SysRng).unwrap(); ``` -------------------------------- ### Seed ChaCha12Rng from a Master Generator Source: https://docs.rs/rand_chacha/0.10.0/rand_chacha/index.html Construct a ChaCha12Rng instance using a master generator as a seed source. ```rust let rng = ChaCha12Rng::from_rng(&mut rand::rng()); ``` -------------------------------- ### ChaCha12Core Struct Definition Source: https://docs.rs/rand_chacha/0.10.0/rand_chacha/struct.ChaCha12Core.html The primary structure definition for the ChaCha12Core cipher. ```rust pub struct ChaCha12Core { /* private fields */ } ``` -------------------------------- ### ChaCha8Core Struct Definition Source: https://docs.rs/rand_chacha/0.10.0/rand_chacha/struct.ChaCha8Core.html The primary structure definition for the ChaCha8Core cipher. ```rust pub struct ChaCha8Core { /* private fields */ } ``` -------------------------------- ### get_stream Source: https://docs.rs/rand_chacha/0.10.0/rand_chacha/type.ChaChaRng.html Retrieves the current stream number. ```APIDOC ## pub fn get_stream(&self) -> u64 ### Description Returns the currently configured stream number. ``` -------------------------------- ### ChaCha20Rng struct definition Source: https://docs.rs/rand_chacha/0.10.0/rand_chacha/struct.ChaCha20Rng.html The definition of the ChaCha20Rng struct. ```rust pub struct ChaCha20Rng { /* private fields */ } ``` -------------------------------- ### get_seed Source: https://docs.rs/rand_chacha/0.10.0/rand_chacha/type.ChaChaRng.html Retrieves the seed used by the generator. ```APIDOC ## pub fn get_seed(&self) -> [u8; 32] ### Description Returns the 32-byte seed currently in use. ``` -------------------------------- ### ChaCha12Rng Word Layout Source: https://docs.rs/rand_chacha/0.10.0/rand_chacha/struct.ChaCha12Rng.html The memory layout of the sixteen u32 words used by the ChaCha algorithm. ```text constant constant constant constant seed seed seed seed seed seed seed seed counter counter stream_id stream_id ``` -------------------------------- ### ChaChaRng Struct Definition Source: https://docs.rs/rand_chacha/0.10.0/rand_chacha/type.ChaChaRng.html The internal structure definition for the aliased type. ```rust pub struct ChaChaRng { /* private fields */ } ``` -------------------------------- ### ChaChaCore Struct Definition Source: https://docs.rs/rand_chacha/0.10.0/rand_chacha/type.ChaChaCore.html The internal structure definition for the aliased type. ```rust pub struct ChaChaCore { /* private fields */ } ``` -------------------------------- ### ChaCha12Rng Struct Definition Source: https://docs.rs/rand_chacha/0.10.0/rand_chacha/struct.ChaCha12Rng.html The internal structure definition for the ChaCha12Rng random number generator. ```rust pub struct ChaCha12Rng { /* private fields */ } ``` -------------------------------- ### ChaChaCore Type Alias Definition Source: https://docs.rs/rand_chacha/0.10.0/rand_chacha/type.ChaChaCore.html The definition of the ChaChaCore type alias. ```rust pub type ChaChaCore = ChaCha20Core; ``` -------------------------------- ### ChaCha8Rng Struct Definition Source: https://docs.rs/rand_chacha/0.10.0/rand_chacha/struct.ChaCha8Rng.html The internal structure definition for the ChaCha8Rng random number generator. ```rust pub struct ChaCha8Rng { /* private fields */ } ``` -------------------------------- ### Define ChaChaRng Type Alias Source: https://docs.rs/rand_chacha/0.10.0/rand_chacha/type.ChaChaRng.html The type alias definition for ChaChaRng. ```rust pub type ChaChaRng = ChaCha20Rng; ``` -------------------------------- ### set_stream Source: https://docs.rs/rand_chacha/0.10.0/rand_chacha/type.ChaChaRng.html Sets the stream number for the generator. ```APIDOC ## pub fn set_stream(&mut self, stream: u64) ### Description Configures the stream identifier. There are 2^64 unique streams available per seed/key. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.