Skip to content

Commit

Permalink
v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lpil committed Aug 6, 2023
1 parent e3fbcaf commit cc0955c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion gleam.toml
Original file line number Diff line number Diff line change
@@ -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"]
Expand Down
10 changes: 5 additions & 5 deletions src/beecrypt.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub fn verify(password: String, hash: String) -> Bool {
crypto.secure_compare(<<hash:utf8>>, <<hashed:utf8>>)
}

external type BcrypeErlangError
type BcrypeErlangError

fn generate_salt() -> String {
let assert Ok(salt) = gen_salt()
Expand All @@ -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)

0 comments on commit cc0955c

Please sign in to comment.