ksuid

Table of Contents

Function

ksuid — encode/decode KSUID-style unique identifiers

Synopsis

ksuid() -> bytes
ksuid(b: bytes) -> string
ksuid(s: string) -> bytes

Description

The ksuid function either encodes a KSUID (a byte sequence of length 20) b into a Base62 string or decodes a KSUID Base62 string into a 20-byte Zed bytes value.

If ksuid is called with no arguments, a new KSUID is generated and returned as a bytes value.

Example:

id := ksuid(id)
true
Loading...
Next: len

SuperDB