Packages

SHA-2 for Gleam

Retired package: Deprecated - Use package glesha instead

Current section

Files

Jump to
glesha2 src sha2_ffi.erl
Raw

src/sha2_ffi.erl

-module(sha2_ffi).
-export([hash/2, hmac/3, hex/1]).
hash(Data, Algorithm) ->
crypto:hash(Algorithm, Data).
hmac(Data, Key, Algorithm) ->
crypto:mac(hmac, Algorithm, Key, Data).
hex(Input) ->
binary:encode_hex(Input, lowercase).