Versions in this module Expand all Collapse all v1 v1.0.6 Mar 9, 2025 Changes in this version + const BYTE_SIZE + const INTEGER_BYTES_32 + const INTEGER_SIZE_32 + const NODE_BITS_1024 + const RANDOM_BITS + const RANDOM_MASK + const TSID_BYTES + const TSID_CHARS + const TSID_EPOCH + var ALPHABET_LOWERCASE []rune = []rune("0123456789abcdefghjkmnpqrstvwxyz") + var ALPHABET_UPPERCASE []rune = []rune("0123456789ABCDEFGHJKMNPQRSTVWXYZ") + var ALPHABET_VALUES []int64 + func IsValidRuneArray(arr []rune) bool + func NewByteRandom(randomSupplier RandomSupplier) *byteRandom + func NewByteRandomWithSupplierFunc(randomSupplierFunc func(length int32) ([]byte, error)) *byteRandom + func NewCryptoRandomSupplier() *cryptoRandomSupplier + func NewIntRandom(intSupplier IntSupplier) *intRandom + func NewIntRandomWithSupplierFunc(intSupplierFunc func() (int32, error)) *intRandom + func NewMathRandomSupplier() *mathRandomSupplier + func ToRuneArray(str string) []rune + func TsidFactoryBuilder() *tsidFactoryBuilder + type ByteSupplier interface + GetBytes func(length int32) ([]byte, error) + type Clock interface + UnixMilli func() int64 + type IntSupplier interface + GetInt func() (int32, error) + type Random interface + NextBytes func(length int32) ([]byte, error) + NextInt func() (int32, error) + type RandomSupplier interface + GetBytes func(length int32) ([]byte, error) + GetInt func() (int32, error) + type Tsid struct + func Fast() *Tsid + func FromBytes(bytes []byte) *Tsid + func FromNumber(number int64) *Tsid + func FromString(str string) *Tsid + func NewTsid(number int64) *Tsid + func (t *Tsid) GetRandom() int64 + func (t *Tsid) GetUnixMillis() int64 + func (t *Tsid) GetUnixMillisWithCustomEpoch(epoch int64) int64 + func (t *Tsid) IsValid(str string) bool + func (t *Tsid) ToBytes() []byte + func (t *Tsid) ToLowerCase() string + func (t *Tsid) ToNumber() int64 + func (t *Tsid) ToString() string + func (t *Tsid) ToStringWithAlphabets(alphabets []rune) string + type TsidFactory struct + func (factory *TsidFactory) Generate() (*Tsid, error)