ntrepid8 / ex_crypto

Wrapper around the Erlang crypto module for Elixir.
MIT License
144 stars 48 forks source link

Base.url_decode64 #1

Closed InoMurko closed 7 years ago

InoMurko commented 7 years ago

Hi,

what's the reason to use url_decode64 and not decode64? https://github.com/ntrepid8/ex_crypto/blob/master/lib/ex_public_key.ex#L166

ntrepid8 commented 7 years ago

The main reason was just to be consistent in the library about how we encode/decode. There are times when it's convenient to pass tokens in the query string of a GET HTTP request and since those require URL safe encoding I just went with that.

Is it causing problems for something you want to use the library for?

InoMurko commented 7 years ago

To be consistent it makes sense. But my impression is that bare 64 is more popular or more often used then url 64. But you're right, depends for what you're using it for. We're using encode16 and 64 for other things - consistency wise it would not suite us to use url_encode64.

Maybe something we could make configurable?

ntrepid8 commented 7 years ago

I think we can do an optional keyword list where options like that can be passed in. Would that work for your use case?

InoMurko commented 7 years ago

Definitely. Much appreciated!