Nf.Crypto (neo_faker v0.6.0)

View Source

Provides functions for generating cryptographic hashes.

Options

The accepted options are:

  • :case - Specifies the character case of the output.

The values for :case can be:

  • :lower (default) - Uses lowercase characters.
  • :upper - Uses uppercase characters.

Summary

Functions

Generates a random MD5 hash.

Generates a random SHA-1 hash.

Generates a random SHA-256 hash.

Functions

md5(opts \\ [])

(since 0.3.1)
@spec md5(Keyword.t()) :: String.t()

Generates a random MD5 hash.

Returns a random MD5 hash string.

See the module documentation for available options.

Examples

iex> Nf.Crypto.md5()
"e35cb102765cfc56df21ba4c16e6a636"

sha1(opts \\ [])

(since 0.3.1)
@spec sha1(Keyword.t()) :: String.t()

Generates a random SHA-1 hash.

Returns a random SHA-1 hash string.

See the module documentation for available options.

Examples

iex> Nf.Crypto.sha1()
"c8719790cdfff41c37c75e0c848d2b57535255aa"

sha256(opts \\ [])

(since 0.3.1)
@spec sha256(Keyword.t()) :: String.t()

Generates a random SHA-256 hash.

Returns a random SHA-256 hash string.

See the module documentation for available options.

Examples

iex> Nf.Crypto.sha256()
"d0ff021e810fb8f3442a14393604b0661b02f0dfcb347d80c9580af3ab5e7e6c"