The secrets module is used for generating cryptographically strong random numbers suitable for managing data such as passwords, account authentication, security tokens, and related secrets.
The secrets module is used for generating cryptographically strong random numbers suitable for managing data such as passwords, account authentication, security tokens, and related secrets.
(choice collection)
Return a randomly-chosen element from a non-empty coll.
Return a randomly-chosen element from a non-empty coll.
(choices population k)
Return a k sized list of elements chosen from the population with replacement. If the population is empty, raises an exception.
Return a k sized list of elements chosen from the population with replacement. If the population is empty, raises an exception.
(randbelow n)
Return a random int in the range [0, n).
Return a random int in the range [0, n).
(randbits k)
Returns a random integer with k random bits.
Returns a random integer with k random bits.
Creates a secure random number generator (RNG).
Creates a secure random number generator (RNG).
(token-bytes)
(token-bytes nbytes)
Return a random byte string containing nbytes number of bytes. If nbytes is nil or not supplied, a reasonable default is used.
Return a random byte string containing nbytes number of bytes. If nbytes is nil or not supplied, a reasonable default is used.
(token-hex)
(token-hex nbytes)
Return a random text string, in hexadecimal. The string has nbytes random bytes, each byte converted to two hex digits. If nbytes is nil or not supplied, a reasonable default is used (default-number-of-bytes).
Return a random text string, in hexadecimal. The string has nbytes random bytes, each byte converted to two hex digits. If nbytes is nil or not supplied, a reasonable default is used (default-number-of-bytes).
(token-urlsafe)
(token-urlsafe nbytes)
Return a random URL-safe text string, containing nbytes random bytes. The text is Base64 encoded, so on average each byte results in approximately 1.3 characters. If nbytes is nil or not supplied, a reasonable default is used (default-number-of-bytes).
Return a random URL-safe text string, containing nbytes random bytes. The text is Base64 encoded, so on average each byte results in approximately 1.3 characters. If nbytes is nil or not supplied, a reasonable default is used (default-number-of-bytes).
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close