Skip to content

Commit dfab815

Browse files
caiopolpil
authored andcommitted
Rename function to bounded_hash and update CHANGELOG
1 parent aaee263 commit dfab815

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## Unreleased
4+
- The `gleam/erlang` module gains the `hash` and
5+
`bounded_hash` functions.
6+
37
## v0.30.0 - 2024-11-11
48

59
- The `gleam/erlang/process` module gains the `deselecting` function.

src/gleam/erlang.gleam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ pub fn priv_directory(name: String) -> Result(String, Nil)
216216
///
217217
/// <https://www.erlang.org/doc/apps/erts/erlang.html#phash2/2>
218218
@external(erlang, "erlang", "phash2")
219-
pub fn hash_range(term: anything, limit limit: Int) -> Int
219+
pub fn bounded_hash(term: anything, limit limit: Int) -> Int
220220

221221
/// Equivalent to hash_range.
222222
/// Returns a value in the range 0..2^27-1

test/gleam/erlang_test.gleam

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ pub fn priv_directory_test() {
8080
let assert True = string.ends_with(dir, "/gleam_stdlib/priv")
8181
}
8282

83-
pub fn hash_range_test() {
84-
let assert 9 = erlang.hash_range("hello", limit: 10)
85-
let assert 0 = erlang.hash_range([5, 2, 8], limit: 10)
86-
let assert 82 = erlang.hash_range(Ok(#("testing", 123)), limit: 200)
83+
pub fn bounded_hash_test() {
84+
let assert 9 = erlang.bounded_hash("hello", limit: 10)
85+
let assert 0 = erlang.bounded_hash([5, 2, 8], limit: 10)
86+
let assert 82 = erlang.bounded_hash(Ok(#("testing", 123)), limit: 200)
8787
}
8888

8989
pub fn hash_test() {

0 commit comments

Comments
 (0)