# # Introduction

## # Base32

Base32 is a data encoding standard specified in RFC 4648, section 6.
It encodes a byte sequence of arbitrary length to a string consisting of only the letters `A`

to `Z`

and the digits
`2`

to `7`

.
This is an alphabet with 32 different characters, hence the name.
In addition, the string gets padded with `=`

characters at the end until its length is a multiple of eight.

Base32 is a good choice for verbal transmission of binary data, e.g. on the phone, because case is insignificant and the alphabet solely consists of uppercase letters and digits which could not be mistaken easily.

## # Base32Check1

Base32Check1 is a custom, one-character checksum algorithm for the Base32 alphabet which has been originally designed by Thaddée Tyl and is described in a blog posting published online on April 29th, 2019. It is based on a scientific article from Yanling Chen, Markku Niemenmaa and A. J. Han Vinck, published online by Springer on April 2nd, 2015. The implementation is also based on some specific optimizations for binary numbers, published online by John Kerl on April, 2004.

According to the article on Springer, the algorithm reliably detects the following errors, which together account for more than 90% of the most frequent transmission errors according to statistical analysis independently conducted by D.F. Beckley and J. Verhoeff:

Error | Example |
---|---|

single character substitution | `..A..` → `..B..` |

character transposition with zero characters in between them | `..AB..` → `..BA..` |

character transposition with one character in between them | `..ABC..` → `..CBA..` |

identical substitution of two identical characters with zero characters in between them | `..AA..` → `..BB..` |

identical substitution of two identical characters with one character in between them | `..ACA..` → `..BCB..` |

## DETAILS

Part of the Base32Check1 algorithm is an arbitrary
primitive polynomial.
We have chosen this primitive polynomial to be 1 + x + x^{3} + x^{4} + x^{5}, which is
different from the one chosen by Thaddée Tyl, which is 1 + x^{2} + x^{5}.
**As a consequence, the checksums computed by our implementations are different from the ones computed by the
original Javascript implementation!**
Alongside the sample implementations we also provide test code as evidence that the algorithm's desired properties still
hold.

Samples →