Current section
Files
Jump to
Current section
Files
src/glib@hash.erl
-module(glib@hash).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([hash/1]).
-spec hash(binary()) -> integer().
hash(Value) ->
_pipe = gleam@string:to_utf_codepoints(Value),
gleam@list:fold(
_pipe,
0,
fun(Acc, X) -> gleam@string:utf_codepoint_to_int(X) + (31 * Acc) end
).