ironseed {ironseed}R Documentation

Ironseed: Improved Random Number Generator Seeding

Description

An ironseed is a 256-bit hash digest constructed from a variable-length input sequence and can be used to generate a variable-length output sequence of seeds, including initializing R's built-in random number generator.

Usage

ironseed(..., set_seed = !has_random_seed(), quiet = FALSE)

create_seedseq(fe, n)

is_ironseed(x)

is_ironseed_str(x)

as_ironseed(x)

parse_ironseed_str(x)

Arguments

...

objects

set_seed

a logical indicating whether to initialize .Random.seed.

quiet

a logical indicating whether to silence messages.

fe

an ironseed

n

a scalar integer specifying the number of seeds to generate

x

a string, ironseed, or other object

Details

Ironseeds have a specific string representation, e.g. "rBQSjhjYv1d-z8dfMATEicf-sw1NSWAvVDi-bQaKSKKQmz1", where each element is a 64-bit number encoded in little-endian base58 format.

Parameter set_seed defaults to TRUE if .Random.seed does not already exist and FALSE otherwise.

Ironseed behaves differently depending on the number of arguments passed as ....

An ironseed is a finite-entropy (or fixed-entropy) hash digest that can be used to generate an unlimited sequence of seeds for initializing the state of a random number generator. It is inspired by the work of M.E. O’Neill and others.

An ironseed is a 256-bit hash digest constructed from a variable-length sequence of 32-bit inputs. Each ironseed consists of eight 32-bit sub-digests. The sub-digests are 32-bit multilinear hashes that accumulate entropy from the input sequence. Each input is included in every sub-digest. The coefficients for the multilinear hashes are generated by a Weyl sequence.

Multilinear hashes are also used to generate an output seed sequence from an ironseed. Each 32-bit output value is generated by uniquely hashing the sub-digests. The coefficients for the output are generated by a second Weyl sequence.

Value

An ironseed. If .Random.seed was initialized, the ironseed used will be returned invisibly.

References

See Also

.Random.seed

Examples




# Generate an ironseed with user supplied data
ironseed::ironseed("Experiment", 20251031, 1)

# Generate an ironseed automatically and initialize `.Random.seed` with it
ironseed::ironseed(set_seed = TRUE)




[Package ironseed version 0.1.0 Index]