CrockfordBase32

Base 32 encoding by Douglas Crockford: https://www.crockford.com/base32.html

Base 32 encoding by Douglas Crockford: https://www.crockford.com/base32.html

class Object
trait Matchable
class Any

Value members

Concrete methods

@inline
def decode(ch: Char): Byte
def decode128bits(s: String): (Long, Long)

Decode a string representation of 128 bit value (26 characters) as a pair of (Long, Long) (128 bits)

Decode a string representation of 128 bit value (26 characters) as a pair of (Long, Long) (128 bits)

Note that technically 26 characters x 5 bite can represent 130-bit values. This method will discard the top 2 bits from the string as ULID only uses 128 bits.

def decode48bits(s: String): Long

Decode 10-character Crockford Base32 as a 48-bit unsigned value. This is used for decoding ULID timestamp (48-bit value)

Decode 10-character Crockford Base32 as a 48-bit unsigned value. This is used for decoding ULID timestamp (48-bit value)

@inline
def encode(i: Int): Char
def encode128bits(hi: Long, low: Long): String

Encode 128-bit values (Long, Long) with Crockford Base32

Encode 128-bit values (Long, Long) with Crockford Base32

def isValidBase32(s: String): Boolean