module EncoderUtils

Overview

Shared helpers for encoder implementations.

Extended Modules

Defined in:

encoders/core.cr

Constant Summary

LEET_MAP = {'a' => '4', 'e' => '3', 'i' => '1', 'o' => '0', 's' => '5', 't' => '7', 'l' => '1', 'g' => '9', 'b' => '8'}
MORSE_REVERSE = MORSE_TABLE.invert
MORSE_TABLE = {'A' => ".-", 'B' => "-...", 'C' => "-.-.", 'D' => "-..", 'E' => ".", 'F' => "..-.", 'G' => "--.", 'H' => "....", 'I' => "..", 'J' => ".---", 'K' => "-.-", 'L' => ".-..", 'M' => "--", 'N' => "-.", 'O' => "---", 'P' => ".--.", 'Q' => "--.-", 'R' => ".-.", 'S' => "...", 'T' => "-", 'U' => "..-", 'V' => "...-", 'W' => ".--", 'X' => "-..-", 'Y' => "-.--", 'Z' => "--..", '0' => "-----", '1' => ".----", '2' => "..---", '3' => "...--", '4' => "....-", '5' => ".....", '6' => "-....", '7' => "--...", '8' => "---..", '9' => "----."}

Instance Method Summary

Instance Method Detail

def ascii85_decode(str : String) : String #

[View source]
def ascii85_encode(str : String) : String #

[View source]
def atbash(str : String) : String #

[View source]
def base32_decode(str : String) : String #

Base32 (RFC 4648) decode


[View source]
def base32_encode(str : String) : String #

Base32 (RFC 4648) encode with padding


[View source]
def base64_url_decode(str : String) : String #

[View source]
def base64_url_encode(str : String) : String #

URL-safe Base64 (no padding)


[View source]
def bin_decode(str : String) : String #

[View source]
def bin_encode(str : String) : String #

[View source]
def bytes_to_string(bytes : Array(UInt8)) : String #

Convert an array of UInt8 bytes to a String


[View source]
def charcode_decode(str : String) : String #

[View source]
def charcode_encode(str : String) : String #

[View source]
def crc32_hex(str : String) : String #

CRC32 hex string (lowercase, 8 chars)


[View source]
def crc32_uint(str : String) : UInt32 #

CRC32 (IEEE 802.3) value as UInt32


[View source]
def hex_decode(str : String) : String #

[View source]
def hex_encode(str : String) : String #

[View source]
def html_decode(str : String) : String #

[View source]
def html_encode(str : String) : String #

[View source]
def json_escape(str : String) : String #

[View source]
def json_unescape(str : String) : String #

[View source]
def leet(str : String) : String #

[View source]
def morse_decode(str : String) : String #

[View source]
def morse_encode(str : String) : String #

[View source]
def oct_decode(str : String) : String #

[View source]
def oct_encode(str : String) : String #

[View source]
def punycode_decode(str : String) : String #

[View source]
def punycode_encode(str : String) : String #

[View source]
def redact(str : String) : String #

[View source]
def rot13(str : String) : String #

[View source]
def rot47(str : String) : String #

[View source]
def unicode_decode(str : String) : String #

[View source]
def unicode_encode(str : String) : String #

[View source]