module BaseX
Extended Modules
Defined in:
base_x/alphabets.cr:1base_x/alphabets.cr:36
base_x/base.cr
base_x/exceptions.cr
base_x/version.cr
Constant Summary
-
VERSION =
{{ (`shards version \"/srv/crystaldoc.info/github-wout-base_x-v0.5.1/src/base_x\"`).chomp.stringify }}
Instance Method Summary
-
#decode(str : String, alphabet : String, base = alphabet.size) : Bytes
Converts a base-x string to bytes.
-
#decode_bytes(str : String, alphabet : String, base = alphabet.size) : Bytes
Converts a base-x string to bytes.
-
#decode_int(str : String, alphabet : String, base = alphabet.size) : BigInt
Converts a base-x string to a base10 integer.
-
#encode(bytes : Bytes, alphabet : String, leading_zeroes = true, base = alphabet.size) : String
Converts bytes to a base-x string.
-
#encode(int : Number, alphabet : String, base = alphabet.size) : String
Converts a base10 integer to a base-x string.
Instance Method Detail
def decode(str : String, alphabet : String, base = alphabet.size) : Bytes
#
Converts a base-x string to bytes.
def decode_bytes(str : String, alphabet : String, base = alphabet.size) : Bytes
#
Converts a base-x string to bytes.
def decode_int(str : String, alphabet : String, base = alphabet.size) : BigInt
#
Converts a base-x string to a base10 integer.
def encode(bytes : Bytes, alphabet : String, leading_zeroes = true, base = alphabet.size) : String
#
Converts bytes to a base-x string.
def encode(int : Number, alphabet : String, base = alphabet.size) : String
#
Converts a base10 integer to a base-x string.