module BaseX

Extended Modules

Defined in:

base_x/alphabets.cr:1
base_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

Instance Method Detail

def decode(str : String, alphabet : String, base = alphabet.size) : Bytes #

Converts a base-x string to bytes.


[View source]
def decode_bytes(str : String, alphabet : String, base = alphabet.size) : Bytes #

Converts a base-x string to bytes.


[View source]
def decode_int(str : String, alphabet : String, base = alphabet.size) : BigInt #

Converts a base-x string to a base10 integer.


[View source]
def encode(bytes : Bytes, alphabet : String, leading_zeroes = true, base = alphabet.size) : String #

Converts bytes to a base-x string.


[View source]
def encode(int : Number, alphabet : String, base = alphabet.size) : String #

Converts a base10 integer to a base-x string.


[View source]