Auctoritas v0.1.1 Auctoritas.TokenGenerator View Source
Manages token generation
Link to this section Summary
Functions
Generates a random hexadecimal string to use as a authentication token
Generates a random hexadecimal string to use as a authentication token
Link to this section Functions
Link to this function
generate_token()
View Source
generate_token()
View Source
generate_token() :: String.t()
generate_token() :: String.t()
Generates a random hexadecimal string to use as a authentication token
Examples
iex> Auctoritas.TokenManager.generate_token()
"nD3xJccmcHsm6F3cBt3yx6oVr2brCmotrSRXnI3sITo="
Link to this function
generate_token(length)
View Source
generate_token(length)
View Source
generate_token(non_neg_integer()) :: String.t()
generate_token(non_neg_integer()) :: String.t()
Generates a random hexadecimal string to use as a authentication token
Argument length specifies length of the generated random number in bytes (then converted to hex)
Examples
iex> Auctoritas.TokenManager.generate_token(32)
"iuwBlPj5q/BYazWH1dr12mja3Q7ZvRV122PuTKIaywg="