let input = ""; convert(from:, input:input)
guessed: | |
---|---|
bytes: | |
binary: | |
octal: | |
dec: | |
hex: | |
base32: | |
base36: | |
base64: | |
text: | |
dollcode: | |
dollcode_split: | |
dollnary: |
it does this by
- parsing its inputs to bytes
- additionally interpreting those bytes as a big-endian biguint
- converting the bytes or biguint to all of the available formats
modes
auto
the auto mode works rather simply, it passes the input to the
guess
function, which returns an InputKind
(as an integer) of its guessthe guess is rather simple, and the first result that matches is chosen:
binary: | parsing the input (sans spaces) as base 2 succeeds |
---|---|
dec: | parsing the input (sans spaces) as base 10 succeeds |
hex: | parsing the input (sans spaces) as base 16 succeeds |
base64: | parsing the input as base64 (with or without padding) succeeds |
dollcode: | all characters are in the dollcode character set (▖ , ▘ , ▌ ) |
dollnary: | all characters are in the dollnary character set (│ , ╽ , ╿ , ┃ ) |
binary: | if none of the other arms match |
text
text will always parse as bytes, but converting to text may fail if the bytes are not valid utf-8
dollcode
dollnary
dollnary is a simple 2-bit-per-character encoding, using the digits
│
, ╽
, ╿
, and ┃
the least significant bit is the bottom half of the last character
notably:
- 2 dollnary characters <-> 1 hexadecimal char
- 4 dollnary characters <-> 1 byte
references
[41666-impl ^1 ^2]: https://noe.sh/dollcode
[40796c19-impl ^1]: https://0x0079.codeberg.page/dollcode