Current section
Files
Jump to
Current section
Files
src/glats@internal@util.erl
-module(glats@internal@util).
-compile([no_auto_import, nowarn_unused_vars]).
-export([random_string/1, random_inbox/1]).
-spec random_string(integer()) -> binary().
random_string(Len) ->
_pipe = crypto:strong_rand_bytes(Len),
gleam@base:encode64(_pipe, false).
-spec random_inbox(binary()) -> binary().
random_inbox(Prefix) ->
Prefix@1 = case Prefix of
<<""/utf8>> ->
<<"_INBOX."/utf8>>;
P ->
P
end,
<<Prefix@1/binary, (random_string(16))/binary>>.