TamaOAuth.Crypto (tama_oauth v0.1.0)

Copy Markdown View Source

Cryptographic helpers for opaque OAuth credentials and their digests.

Summary

Functions

digest(value)

@spec digest(binary()) :: binary()

matches_digest?(value, expected)

@spec matches_digest?(term(), term()) :: boolean()

opaque_token(bytes \\ 32, random_bytes \\ &:crypto.strong_rand_bytes/1)

@spec opaque_token(pos_integer(), (pos_integer() -> binary())) :: String.t()

secure_compare(left, right)

@spec secure_compare(term(), term()) :: boolean()