Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lpil/antigone
Argon2 password hashing for Gleam.
https://github.com/lpil/antigone
Last synced: about 1 month ago
JSON representation
Argon2 password hashing for Gleam.
- Host: GitHub
- URL: https://github.com/lpil/antigone
- Owner: lpil
- Created: 2024-03-25T22:23:06.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-06-01T14:47:27.000Z (5 months ago)
- Last Synced: 2024-09-16T18:22:49.315Z (about 2 months ago)
- Language: Gleam
- Homepage:
- Size: 6.84 KB
- Stars: 18
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
- awesome-gleam - bucket - [📚](https://hexdocs.pm/bucket/) - Gleam S3 API client, suitable for AWS S3, Garage, Minio, Storj, Backblaze B2, Cloudflare R2, Ceph, Wasabi, and so on! (Packages / SDKs)
README
# antigone
Argon2 password hashing for Gleam.
[![Package Version](https://img.shields.io/hexpm/v/antigone)](https://hex.pm/packages/antigone)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/antigone/)This package uses the [elixir_argon2](https://github.com/riverrun/argon2_elixir)
library, so you will need to have Elixir installed and be running on Erlang to
use this package.```sh
gleam add antigone
```
```gleam
import antigone
import gleam/bit_arraypub fn main() {
// You've got a password or token you wish to hash so that you can verify it
// later without having to store the password or hash itself.
let password = bit_array.from_string("blink182")// Hash the password with the default configuration:
antigone.hash(antigone.hasher(), password)
// -> "$argon2id$v=19$m=65536,t=3,p=4$h1bn4Va1EXJ+kReN0/q45Q$KMj1OQV0tueWPFKw97bB+RVGsYgdPpiVxZibzbc3dBw"// Alternatively you can specify your own configuration.
// Here we are lowering the costs to make the hashing faster. You may want to
// do this in your tests, but you must never do this in production.
antigone.hasher()
|> antigone.time_cost(1)
|> antigone.memory_cost(8)
|> antigone.hash(password)
// -> "$argon2id$v=19$m=256,t=1,p=4$Q7MevutDdDKNtKFvygG7QQ$Ta+IOOaBq6iOfvUqBvehHmnVUzjpzOV7g3B+3VKqLfo"
}
```Further documentation can be found at .
### Why it is called Antigone?
I really liked X2: The Threat as a kid.