ksuid — encode/decode KSUID-style unique identifiers
ksuid() -> bytes
ksuid(b: bytes) -> string
ksuid(s: string) -> bytes
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.
echo '{id:0x0dfc90519b60f362e84a3fdddd9b9e63e1fb90d1}' |
super -z -c 'id := ksuid(id)' -
=>
{id:"1zjJzTWWCJNVrGwqB8kZwhTM2fR"}