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)
{id:0x0dfc90519b60f362e84a3fdddd9b9e63e1fb90d1} 
Loading...
Next: len

SuperDB