Packages

Gleam bindings to fast_pbkdf2 NIF of PBKDF2 (Password-Based Key Derivation Function 2) for Erlang.

Current section

Files

Jump to
pinkdf2 src extern.erl
Raw

src/extern.erl

-module(extern).
-export([get_salt/0]).
get_salt() ->
<<Num:32/integer>> = crypto:strong_rand_bytes(4),
BytesNum = Num rem (1024 - 64) + 64,
Raw = crypto:strong_rand_bytes(BytesNum),
base64:encode(Raw).