Skip to content
ransu
Search
Ctrl
K
Cancel
GitHub
npm
Select theme
Dark
Light
Auto
Start here
Introduction
Install
Choosing an API
Guides
Numbers and ranges
Collections
Text and Unicode
Identifiers
Distributions
Reproducibility
Security
Dice, shapes and colours
Retries and scheduling
Per-key randomness
Reference
Subpaths
Engines
Errors
Runtimes
API reference
color
Interfaces
ColorOptions
Type Aliases
Span
Functions
color
hsl
rgb
compat
Interfaces
PureRandLike
Type Aliases
SeedrandomLike
Functions
fromMathRandom
fromPureRand
fromSeedrandom
toMathRandom
dice
Interfaces
DiceApi
Roll
Variables
d10
d100
d12
d20
d4
d6
d8
dice
Functions
coin
distribution
Interfaces
BernoulliOptions
BetaOptions
BinomialOptions
CategoricalOptions
ChiSquaredOptions
DirichletOptions
DiscreteUniformOptions
DistributionOptions
ExponentialOptions
FOptions
GammaOptions
GeometricOptions
HypergeometricOptions
IrwinHallOptions
LocationScaleOptions
LogNormalOptions
MultinomialOptions
NegativeBinomialOptions
NormalOptions
NumberSampler
PoissonOptions
RayleighOptions
Sampler
ShapeScaleOptions
StudentTOptions
TriangularOptions
UniformOptions
VonMisesOptions
ZipfOptions
Functions
bates
bernoulli
beta
binomial
categorical
cauchy
chiSquared
dirichlet
discreteUniform
exponential
fisherF
gamma
geometric
gumbel
hypergeometric
irwinHall
laplace
logistic
logNormal
multinomial
negativeBinomial
normal
pareto
poisson
rayleigh
studentT
triangular
uniform
vonMises
weibull
zipf
engine
Classes
ChaCha20
CryptoEngine
FunctionEngine
Mt19937
Mulberry32
NativeMathEngine
Pcg32
PrngEngine
Sfc32
Xoshiro128pp
Xoshiro256pp
Variables
cryptoRandom
engines
nativeMath
Functions
chacha20
mt19937
mulberry32
pcg32
sfc32
xoshiro128pp
xoshiro256pp
References
Engine
EngineFactory
EngineLike
EngineState
geometry
Interfaces
Rect
Type Aliases
Point
Functions
angle
angleDegrees
inCircle
inRect
inSphere
onCircle
onSphere
unitVector
hash
Functions
bucket
hashFloat
hashInteger
hashPick
hashRandom
rollout
index
Classes
CodePointSet
Random
RansuError
SeedSequence
Interfaces
Engine
EngineState
RandomOptions
RansuApi
TimeUuidOptions
UnicodeOptions
UuidOptions
Type Aliases
AlphabetName
CodePointRange
Collection
EngineFactory
EngineLike
RansuErrorCode
Seed
UnicodeBlock
Variables
alphabets
NAMESPACE
ransu
unicodeRanges
Functions
bates
below
bernoulli
beta
bigBits
bigint
binomial
bits
bool
bytes
categorical
cauchy
chance
char
chars
chiSquared
choices
codePoint
combination
dirichlet
engine
exponential
fillBytes
fisherF
float
floats
gamma
geometric
getState
graphemes
gumbel
hex
hypergeometric
integer
integers
irwinHall
laplace
logistic
logNormal
multinomial
negativeBinomial
normal
oneIn
pareto
permutation
pick
pickEntry
pickIndex
pickKey
pickValue
poisson
random
range
rayleigh
reservoir
sample
sampleIntegers
seed
setState
shuffle
shuffleInPlace
shuffleString
sign
stream
string
studentT
subset
takeOut
triangular
tryPick
vonMises
weibull
weightedPick
weightedSample
weightedTable
zipf
References
angle
angleDegrees
backoff
BackoffOptions
bucket
coin
color
ColorOptions
d10
d100
d12
d20
d4
d6
d8
date
default
dice
DiceApi
duration
engines
futureDate
hashFloat
hashInteger
hashPick
hashRandom
hsl
inCircle
inRect
inSphere
jitter
nanoid
NANOID_ALPHABET
NanoidOptions
onCircle
onSphere
otp
password
PasswordOptions
pastDate
Point
Rect
rgb
Roll
rollout
Span
TimeInput
token
TokenOptions
ulid
UlidApi
UlidOptions
unitVector
uuid
UuidApi
nanoid
Interfaces
NanoidOptions
Variables
NANOID_ALPHABET
Functions
nanoid
secure
Functions
below
bigint
bits
bool
bytes
chance
choices
fillBytes
float
hex
integer
oneIn
permutation
pick
pickIndex
random
range
sample
seed
shuffle
shuffleInPlace
string
tryPick
weightedPick
References
nanoid
otp
password
token
ulid
uuid
time
Interfaces
BackoffOptions
Type Aliases
TimeInput
Functions
backoff
date
duration
futureDate
jitter
pastDate
token
Interfaces
PasswordOptions
TokenOptions
Functions
otp
password
token
ulid
Interfaces
UlidApi
UlidOptions
Variables
ulid
unicode
Variables
MAX_CODE_POINT
Functions
graphemes
References
char
chars
codePoint
CodePointRange
CodePointSet
UnicodeBlock
UnicodeOptions
unicodeRanges
uuid
Interfaces
UuidApi
Type Aliases
NamespaceName
Variables
DCE_DOMAIN
MAX
NIL
uuid
Functions
compare
parse
stringify
timestamp
v1
v1ToV6
v2
v3
v4
v5
v6
v6ToV1
v7
v8
validate
version
References
NAMESPACE
TimeUuidOptions
UuidOptions
Migrating
From other libraries
GitHub
npm
Select theme
Dark
Light
Auto
ransu
Modules
Section titled “Modules”
color
compat
dice
distribution
engine
geometry
hash
index
nanoid
secure
time
token
ulid
unicode
uuid