Page: Safe58
2019-12-13 19:12
Safe58
Topic: base low level architecture concept
This is one of architecture concepts important to know during the software development for Universa integration. Among such topics are:
See GitHub (
Overview
Safe58 is an improvement over the well-known
In Universa, Safe58 is used for encoding of Key address.
Alphabet
As with the Base58 (in Bitcoin or IPFS implementations), it uses the alphabet 123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz
.
Algorithm
The implementation matches the original Base58 implementation, with the extra addition: at the start of the decoding step, the input data is searched for some symbols omitted from Base58 alphabet. If these symbols are found, they are replaced with their in-alphabet counterparts:
I
→1
!
→1
|
→1
l
→1
O
→o
0
→o
Backward compatibility with Base58
When the same alphabet is used, Safe58 and Base58 are very much compatible:
- Any binary string is encoded to the same text representation by both Safe58 and Base58.
- Any text representation containing of valid alphabet symbols only gets decoded to the same binary string.
Unit tests
Available in GitHub: