https://github.com/plackemacher/secure_compare
A secure compare for Elixir.
https://github.com/plackemacher/secure_compare
elixir library package security
Last synced: 10 months ago
JSON representation
A secure compare for Elixir.
- Host: GitHub
- URL: https://github.com/plackemacher/secure_compare
- Owner: plackemacher
- License: mit
- Created: 2016-04-17T16:23:53.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2019-01-23T20:03:13.000Z (about 7 years ago)
- Last Synced: 2025-03-25T20:21:40.370Z (10 months ago)
- Topics: elixir, library, package, security
- Language: Elixir
- Homepage: https://hex.pm/packages/secure_compare
- Size: 9.77 KB
- Stars: 18
- Watchers: 2
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SecureCompare for Elixir
[](https://hex.pm/packages/secure_compare)
[](https://travis-ci.org/plackemacher/secure_compare)
A simple constant-time comparison algorithm for Elixir based on the `Devise.secure_compare` method found [here](https://github.com/plataformatec/devise/blob/69bee06ceee6280b54304928bb6e55c5064abad8/lib/devise.rb#L483).
## Installation
The package can be installed by adding `secure_compare` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:secure_compare, "~> 0.1.0"}]
end
```
## Usage
```elixir
a = "123"
b = "456"
SecureCompare.compare(a, b) # => false
````