Skip to content

SS58 encode/decode arbitrary length data

Compare
Choose a tag to compare
@wyhaines wyhaines released this 15 Mar 00:01
· 4 commits to main since this release

Substrate's SS58 address format doc prescribes checksum lengths only for payloads of 1, 2, 4, 8, or 32 bytes. For any other payload, the behavior is undefined. For lack of any other clear guidance beyond the abundance of 2 byte checksums in the actual live use of SS58, this library is implementing a default checksum of 2 bytes for otherwise undefined payload lengths. This change adds a Base58::SS58.encode and a Base58::SS58.decode method for dealing with arbitrary data, of arbitrary sizes.