summaryrefslogtreecommitdiffhomepage
path: root/gleam/src/ocda_ffi.erl
blob: 2e395cd0a5ceea940f2a84e1174c92f9b3247333 (plain)
1
2
3
4
5
6
7
%% The one thing ocda-lib asks of Erlang directly: a sha256, which OTP's
%% crypto has and the Gleam standard library does not. Upper case hex, as
%% the database stores it and the D library writes it.
-module(ocda_ffi).
-export([sha256_hex/1]).

sha256_hex(Bin) -> binary:encode_hex(crypto:hash(sha256, Bin)).