package
Version:
v0.5.3
Opens a new window with list of versions in this module.
Published: Apr 18, 2026
License: MIT
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package random provides cryptographically secure random number
and string generation functions.
Bytes generates random bytes and returns them as a base64-encoded string.
Float generates a random float64 between 0.0 and 1.0.
Hex generates random bytes and returns them as a hex-encoded string.
ID generates a globally unique sortable ID using xid.
Returns a 20-character string that is smaller than UUID and sortable by creation time.
Int generates a cryptographically secure random integer between min and max (inclusive).
Falls back to math/rand on crypto/rand errors.
String generates a random alphanumeric string of the specified length.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.