diff options
Diffstat (limited to 'gleam/src/ocda_ffi.erl')
| -rw-r--r-- | gleam/src/ocda_ffi.erl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gleam/src/ocda_ffi.erl b/gleam/src/ocda_ffi.erl new file mode 100644 index 0000000..2e395cd --- /dev/null +++ b/gleam/src/ocda_ffi.erl @@ -0,0 +1,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)). |
