kirei / python-base45

Base45
BSD 2-Clause "Simplified" License
21 stars 8 forks source link

Fix single byte/char edge cases in both encode and decode #7

Closed lucaslugao closed 3 years ago

lucaslugao commented 3 years ago

This PR fixes single byte encoding issues caused by the use of unbound variable i in the odd length case. It also adds a corresponding check in the decode function to discard impossible one char long encoded strings. Tests were added to prevent regression.