Algorithms

CRC-16/XMODEM

Polynomial 0x1021 with init 0. The two bytes closing Stellar StrKeys and TON addresses
IDcrc16-xmodem35 / 46CRC · 16-bit
Hash / Non-cryptographic

CRC-16/XMODEM

Two bytes that close an address.

Digest
16-bit · 2 bytes
HMAC
no key mode
Security
NOT for security
Used by
Stellar, TON
3 options, 0 required

Sample

hex
3be4
base64
O+Q=

Options

encodingstring
default hex
Output encoding: hex, base64, base64url, binary
roundsnumber
default 1
How many times to hash, each round hashing the previous digest
chainstring
default bytes
What each round after the first hashes: bytes of the digest, or its lowercase hex

Access

Createcreate("crc16-xmodem")
CLIhashes crc16-xmodem 'hello world'
Tryplayground with the sample above
Kincrc32, crc64, crc24

CRC-16 with polynomial 0x1021, initial value 0, no reflection. Two bytes that end every Stellar StrKey (the G… account IDs) and every TON friendly address.

ts
create("crc16-xmodem").hash("123456789").digest; // "31c3", the standard check value

Printed big-endian, the way TON writes it. Stellar stores the same two bytes little-endian, so for a StrKey swap them. Checksum only, not for security.