From cc0955c419ea7f83dc2ad1138dd9e295fa4780ca Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Sun, 6 Aug 2023 21:32:57 +0100 Subject: [PATCH] v0.2.0 --- CHANGELOG.md | 4 ++++ gleam.toml | 2 +- src/beecrypt.gleam | 10 +++++----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5671290..e59ea3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## v0.2.0 - 2023-08-06 + +- Updated for Gleam v0.30.0. + ## v0.1.0 - 2023-05-11 - Initial release. diff --git a/gleam.toml b/gleam.toml index 9e0d117..9180779 100644 --- a/gleam.toml +++ b/gleam.toml @@ -1,5 +1,5 @@ name = "beecrypt" -version = "0.1.0" +version = "0.2.0" description = "Buzzing Gleam bindings to the Erlang bcrypt hashing library" licences = ["Apache-2.0"] diff --git a/src/beecrypt.gleam b/src/beecrypt.gleam index 4e50a24..b442b25 100644 --- a/src/beecrypt.gleam +++ b/src/beecrypt.gleam @@ -13,7 +13,7 @@ pub fn verify(password: String, hash: String) -> Bool { crypto.secure_compare(<>, <>) } -external type BcrypeErlangError +type BcrypeErlangError fn generate_salt() -> String { let assert Ok(salt) = gen_salt() @@ -25,8 +25,8 @@ fn hash_with_salt(password: String, salt: String) -> String { charlist.to_string(hash) } -external fn gen_salt() -> Result(Charlist, BcrypeErlangError) = - "bcrypt" "gen_salt" +@external(erlang, "bcrypt", "gen_salt") +fn gen_salt() -> Result(Charlist, BcrypeErlangError) -external fn hashpw(String, String) -> Result(Charlist, BcrypeErlangError) = - "bcrypt" "hashpw" +@external(erlang, "bcrypt", "hashpw") +fn hashpw(a: String, b: String) -> Result(Charlist, BcrypeErlangError)