Computing system based on the number 62, 36 or 16
Find a file
Arnas Udovic e1bab41d4b
All checks were successful
Backend Build and Test / backend-tasks (push) Successful in 42s
workflow - go env setup
2026-06-02 15:02:58 +03:00
.forgejo/workflows workflow - go env setup 2026-06-02 15:02:58 +03:00
.gitignore copy from github 2021-05-11 23:21:06 +03:00
abcex.go unified encodin/decoding 2026-05-13 18:22:57 +03:00
abcex_test.go unified encodin/decoding 2026-05-13 18:22:57 +03:00
CHANGELOG unified encodin/decoding 2026-05-13 18:22:57 +03:00
go.mod v4 2025-01-06 21:37:40 +02:00
README.md build badge update; workflow update 2026-06-02 14:35:29 +03:00

abcex

Version Build Status

Computing system based on the number 62, 36 or 16

Usage

Encode(int, int) -> string - convert number into string based on given base.

Decode(string, int) -> int - convert from encoded string into number based on given base.

Convert(string, int, int) -> string - convert encoded string from one base to another.

Valid(string, int) -> bool - check if string is valid for given base.

Plus(string, string, int) -> string - add two encoded strings for given base.

Minus(string, string, int) -> string - subtract two encoded strings for given base.

Sum([]string, int) -> string - sum multiple encoded strings for given base.

Encrypt(string, int) -> (string, error) - convert all text elements into integers and replace in text :P

Decrypt(string, int) -> (string, error) - convert all integers into text elements and replace in text ;)

Diacritical marks support

For Lithuanian, Latvian, Samogitian alphabets, we use a mapping during Encrypt/Decrypt:

  • ā, ē, ī, ō, ū are mapped using | marker (e.g., ā -> a|, Ā -> A|)
  • ė, ȧ are mapped using * marker (e.g., ė -> e*, Ė -> E*)
  • š, č, ž are mapped using ^ marker (e.g., š -> s^, Š -> S^)
  • ą, ę, į, ų, ģ, ķ, ļ, ŗ are mapped using + marker (e.g., ą -> a+, Ą -> A+)

Special combinations like ė̄ are supported as e*| (and Ė̄ as E*|). | During encryption, these markers act as delimiters and are preserved in the encrypted text. |, ^, +, and * all appear in the output to separate encoded values.

History

Version 1 - based on 32: number and case insensitive letters

Version 2 - failed release

Version 3 - based on 62: number and case sensitive letters

Version 4 - support both versions, based on 62 and 32

Comparisons

DEC             | abcex.BASE36  | shorter
-----------------------------------------
12              | c             | 2:1
100             | 2s            | 3:2
2000            | 1jk           | 4:3
1000000         | lfls          | 7:4
1000000000      | gjdgxs        | 10:6
1000000000000   | cre66i9s      | 13:8

DEC             | abcex.BASE62  | shorter
-----------------------------------------
12              | C             | 2:1
100             | 1c            | 3:2
2000            | WG            | 4:2
1000000         | 4C92          | 7:4
1000000000      | 15ftgG        | 10:6
1000000000000   | HbXm5a4       | 13:7