Returns baseN encoded version of given binary ID (generated via .nextBinary()
).
Returns a new baseN encoded ID string.
Returns a new ID as byte array.
Takes a KSUID string (assumed to be generated with the same config as this instance) and parses it into an object of: { epoch, id }
, where epoch
is the Unix epoch of the ID and id
the random bytes.
Returns a new baseN encoded ID string for given epoch
(default: current time) and with all random payload bytes set to 0.
Binary version of {@link KSUI.timeOnly}, but returns byte array. The first 4 bytes will contain the timestamp.
Generated using TypeDoc
Returns the byte size of a single ID, based on the KSUID's configuration. The default config (payload 16 bytes) will result in 20-byte IDs (27 chars base62 encoded).