Packages
comeonin
0.8.2
5.5.1
5.5.0
5.4.0
5.3.3
5.3.2
5.3.1
5.3.0
5.2.0
5.1.3
5.1.2
5.1.1
5.1.0
5.0.0
4.1.2
4.1.1
4.1.0
4.0.3
4.0.2
4.0.1
4.0.0
4.0.0-rc.0
3.2.0
3.1.0
3.0.2
3.0.1
3.0.0
2.6.0
2.5.3
2.5.2
2.5.1
2.5.0
2.4.0
2.3.1
2.3.0
2.2.0
2.1.1
2.1.0
2.0.3
2.0.2
2.0.1
2.0.0
1.6.0
1.5.0
1.4.1
1.4.0
1.3.2
1.3.1
1.3.0
1.2.2
1.2.1
1.2.0
1.1.4
1.1.3
1.1.2
1.1.1
1.1.0
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
0.11.3
0.11.2
0.11.1
0.11.0
0.10.0
0.9.0
0.8.2
0.8.1
0.8.0
0.7.0
0.6.0
0.5.1
0.5.0
0.4.0
0.3.1
0.3.0
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.1.1
0.1.0
A specification for password hashing libraries
Current section
Files
Jump to
Current section
Files
lib/comeonin/config.ex
defmodule Comeonin.Config do
@moduledoc """
This module provides an abstraction layer for configuration.
The following are valid configuration items.
| name | type | default |
| :----------------- | :------ | ------: |
| bcrypt_log_rounds | integer | 12 |
| pbkdf2_rounds | integer | 60000 |
Please read the documentation for the main `Comeonin` module,
which explains why the default values are not always the best
values to use.
## Examples
The simplest way to change the default values would be to add
the following to the `config.exs` file in your project.
config :comeonin,
bcrypt_log_rounds: 14,
pbkdf2_rounds: 100_000
If you want to have different values when developing and testing,
you can create separate files for each environment: `dev.exs`,
`prod.exs` and `test.exs`, and add the configuration values to
the respective file.
For example, in `test.exs` and `dev.exs`:
use Mix.Config
config :comeonin,
bcrypt_log_rounds: 4,
pbkdf2_rounds: 1_000
And in `prod.exs`:
use Mix.Config
config :comeonin,
bcrypt_log_rounds: 14,
pbkdf2_rounds: 100_000
If you use separate files for the different environments, remember
to add, or uncomment, the line `import_config "#\{Mix.env\}.exs"`
to the `config.exs` file.
"""
def bcrypt_log_rounds do
Application.get_env(:comeonin, :bcrypt_log_rounds, 12)
end
def pbkdf2_rounds do
Application.get_env(:comeonin, :pbkdf2_rounds, 60_000)
end
end