Expand description
A set of helpers functions.
Constants§
- REGULAR_
ALPHABET - The 26-letter alphabet we know and love in the Western part of the world
- SC_
ALPHABET - Default alphabet containing A-Z plus special characters ‘/’ and ‘-’. The ‘/’ character is used as a digit escape marker in encryption.
Functions§
- by_n
- Inserts a space every
ncharacters in a string. - condense
- Removes all duplicate characters from a string, preserving the first occurrence of each.
- condense_
str - Efficiently removes all duplicate characters from a string, returning a new String.
- expand
- Expands a byte slice by inserting ‘X’ between consecutive duplicate characters.
- fix_
double - Replaces consecutive identical characters by inserting a fill character between them.
- fix_
double_ aligned - Replaces consecutive identical characters by inserting a fill character between them, but only when the duplicate pair falls on a 2-character boundary.
- insert
- insert one character inside the array
- output_
as_ block - Formats a string into blocks of 5 characters separated by spaces.
- shuffle
- Shuffles an alphabet using a keyword to create a mixed alphabet for cipher use.
- to_
numeric - Converts a string key into a numeric representation based on alphabetical order.
- transp_
shuffle - Shuffles an alphabet using a keyword to create a mixed alphabet for cipher use.