ulid-0.3.2.0: Implementation of ULID - Universally Unique Lexicographically Sortable Identifier
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.ULID.Base32

Description

Synopsis

Documentation

encode Source #

Arguments

:: Integral i 
=> Int

Overall length of resulting Text

-> i

Natural number to encode

-> Text

0 padded, Douglas Crockford's base 32 encoded Text

>>> encode 5 123
"0003V"

| >>> encode (-5) (-123) ""

encodeChar :: Integral i => i -> Char Source #

Encode an integer to its corresponding character

decode Source #

Arguments

:: Integral i 
=> Int

Overall length of input Text

-> Text

Base 32 encoded Text

-> [(i, Text)]

List of possible parses

>>> decode 5 "0003V"
[(123,"")]

decodeChar :: Integral i => Char -> Maybe i Source #

Decode a character to its corresponding integer