MCPcopy Create free account
hub / github.com/ashvardanian/StringZilla / random

Method random

include/stringzilla/stringzilla.hpp:4093–4095  ·  view source on GitHub ↗

* @brief Generate a new random binary string of given @p length. * @param[in] length The length of the generated string. * @param[in] nonce "Number used ONCE" to initialize the random number generator, @b don't repeat it! * @throw `std::bad_alloc` if the allocation fails. */

Source from the content-addressed store, hash-verified

4091 * @throw `std::bad_alloc` if the allocation fails.
4092 */
4093 static basic_string random(size_type length, sz_u64_t nonce) noexcept(false) {
4094 return basic_string(length, '\0').fill_random(nonce);
4095 }
4096
4097 /**
4098 * @brief Generate a new random binary string of given @p length.

Callers 1

Calls 1

basic_stringClass · 0.85

Tested by 1