Creates an <ulid>
instance.
TIMESTAMP is a timestamp component of ULID.
It should be a non-negative integer representing Unix time in milliseconds.
Its default value is (ulid:current-time)
.
RANDOM should be an integer or a procedure.
If RANDOM is an integer, it is used as a random component of ULID.
If RANDOM is a procedure, it is called with two arguments,
a byte-size and a timestamp, and should return a random component of ULID,
a non-negative integer that fits in the given byte-size.
RANDOM procedure may use the timestamp argument to ensure monotonicity.
If RANDOM is not specified, a random intger generated
with ulid:urand-read-integer
or ulid:random-integer
is used.
Extracts the timestamp component of ULID as a SRFI-19 <time>
.
Reads a BYTE-SIZE bytes non-negative integer from /dev/urandom
.
If /dev/urandom
is not available, this procedure returns false.
This procedure does not use TIMESTAMP argument.
Generates a BYTE-SIZE bytes non-negative integer by using SRFI-27
random-intger
procedure.
This procedure does not use TIMESTAMP argument.
Note: this procedure may not be cryptographically secure.