Documentation
¶
Overview ¶
Package numconv provides utilities for converting 64-bit integers to/from base32 and base62 encodings. It includes functions for generating random strings in these encodings, making it useful for creating compact, URL-safe identifiers and tokens.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base32ToInt64 ¶
Base32ToInt64 converts a base32 encoded string back to a 64-bit integer. Returns an error if the string contains invalid base32 characters or cannot be decoded.
func Base62ToInt64 ¶
Base62ToInt64 converts a base62 encoded string back to a 64-bit integer. Returns an error if the string contains invalid base62 characters or cannot be decoded.
func Int64ToBase32 ¶
Int64ToBase32 converts a 64-bit integer to its base32 string representation. It uses the standard base32 encoding with Crockford's alphabet.
func Int64ToBase62 ¶
Int64ToBase62 converts a 64-bit integer to its base62 string representation. It uses the standard base62 encoding with alphanumeric characters.
func RandomBase32 ¶
RandomBase32 generates a random base32 string of the specified length. Returns an empty string if length is non-positive.
func RandomBase62 ¶
RandomBase62 generates a random base62 string of the specified length. Returns an empty string if length is non-positive.
Types ¶
This section is empty.