A simple constant-time comparison algorithm for Elixir based on the Devise.secure_compare
method found here.
The package can be installed by adding secure_compare
to your list of dependencies in mix.exs
:
def deps do
[{:secure_compare, "~> 0.1.0"}]
end
a = "123"
b = "456"
SecureCompare.compare(a, b) # => false