Skip to content

Conversation

@KiKoS0
Copy link

@KiKoS0 KiKoS0 commented May 24, 2022

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:

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.

Making the return type compatible with the method's typespec, also stopping raising exceptions when base64 decoding fails or in case the decoded payload is too small.
@darwin67
Copy link

@KiKoS0 test? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants