4 ms·
Your Base32 alphabet only has 31 characters. >>> len("23456789abcdefghjkmnpqrstuvwxyz") 31 >>> (26 + 10) - 5 # a-z0-9, remove 1il0O 31
by Scaevolus 12y ago
Your Base32 alphabet only has 31 characters.
>>> len("23456789abcdefghjkmnpqrstuvwxyz")
31
>>> (26 + 10) - 5 # a-z0-9, remove 1il0O
31
- danieltillett 12y agoSure as I am wanting to avoid letters/number that can be confused by an user. You can change the encoding used to whatever you like. You can use less than 32 characters if you wish. Edit. I do agree that I should make this clearer since if someone uses less than 31 characters then they will run into problems if they don't update my code.
- delinka 12y agopoint is, it's not base32 if there are 31 characters in the alphabet.
- danieltillett 12y agoThe code is base32 - it is just that I am not using one of the characters. If someone needs base32 they can add back one of the characters I removed and it would be fine.
- delinka 12y agoCall it what you like, but it's base-31 and your name is misleading.
- danieltillett 12y agoThe code is base32 I just choose to never use one of the possible base32 digits. The way the Damm algorithm works this is fine to do.