Randomizes the contents of a given byte slice `text` using characters from a specified `alphabet`. This function mutates `text` in place, replacing each byte with a random one from `alphabet`. It is designed for situations where you need to generate random strings or data sequences based on a specific set of characters, such as generating random DNA sequences or testing inputs. # Arguments `buff
(buffer: &mut T, nonce: u64)
| 2116 | /// |
| 2117 | /// After than, `buffer` is filled with random byte values from 0 to 255. |
| 2118 | pub fn fill_random<T>(buffer: &mut T, nonce: u64) |
| 2119 | where |
| 2120 | T: AsMut<[u8]> + ?Sized, // Allows for mutable references to dynamically sized types. |
| 2121 | { |
| 2122 | let buffer_slice = buffer.as_mut(); |
| 2123 | unsafe { |
| 2124 | sz_fill_random(buffer_slice.as_ptr() as _, buffer_slice.len(), nonce); |
| 2125 | } |
| 2126 | } |
| 2127 | |
| 2128 | /// A helper type that holds a mapper closure which, given an index, |
| 2129 | /// returns the corresponding byte-slice representation. |
nothing calls this directly
no test coverage detected
searching dependent graphs…