elixir-mongo / mongodb

MongoDB driver for Elixir
Apache License 2.0
571 stars 156 forks source link

change hmac to mac #360

Closed jrzayev closed 3 years ago

IgorPolyakov commented 3 years ago

Hello!) If you don't want to break backward compatibility you can use some thing like this

 if System.otp_release() >= "22" do
    defp hmac_fun(digest, key), do: &:crypto.mac(:hmac, digest, key, &1)
  else
    defp hmac_fun(digest, key), do: &:crypto.hmac(digest, key, &1)
  end

source https://github.com/elixir-plug/plug_crypto/pull/20/files

scottmessinger commented 3 years ago

@IgorPolyakov that's a great suggestion. @Javid907 Could you make that change? That would be very helpful!

joeapearson commented 3 years ago

Addressed in #364 although without backwards compatibility. If backwards compatibility is desired please can we make that a new PR? Thanks for bearing with us while we clean up these issues.