ratopi / base45

A Base45 encoder/decoder in pure Erlang
Apache License 2.0
0 stars 0 forks source link

Invalid strings could be handled better #1

Closed bortzmeyer closed 1 year ago

bortzmeyer commented 2 years ago

The documentation says "Calling decode with an illegal input string (like <<"GGW">>, which leads to 65536), will throw an illegale_encoding exception" but it is not true for all invalid strings. For instance, <<"=">> will throw a function clause exception.

ratopi commented 1 year ago

Thank you for your hint. I'm currently thinking about the <<=>> "problem". What is the correct result? 0 or an error? What do you think?

bortzmeyer commented 1 year ago

IMHO, same error as <<"GGW">> since I don't think it is valid Base45.

ratopi commented 1 year ago

IMHO it is a different error, due to the fact the "=" does not exist in the base45-alphabet. Therefore I will introduce a second error.

ratopi commented 1 year ago

Fixed in version 2.0.0