Open KiKoS0 opened 2 years ago
Making the return type compatible with the method's typespec, also stopping exceptions from raising when base64 decoding fails or in case the decoded payload is too small. Preventing smaller input to pass too:
base64
iex(5)> payload = Base.url_encode64("AAAAAAAAAAAAAAAA") |> ExCrypto.decode_payload {:ok, {"AAAAAAAAAAAAAAAA", "AAAAAAAAAAAAAAAA", "AAAAAAAAAAAAAAAA"}}
Before this change we need to try-rescue every time decode_payload is called with arbitrary data as argument.
try-rescue
decode_payload
@KiKoS0 test? :)
Making the return type compatible with the method's typespec, also stopping exceptions from raising when
base64
decoding fails or in case the decoded payload is too small. Preventing smaller input to pass too:Before this change we need to
try-rescue
every timedecode_payload
is called with arbitrary data as argument.