Skip to content
This repository has been archived by the owner. It is now read-only.
Browse files
Update documentation to reflect changes
  • Loading branch information
hntrmrrs committed Apr 3, 2011
1 parent ddd2b92 commit e538a31696d192d248697a7cc862205f56b409f6
Showing 1 changed file with 27 additions and 15 deletions.
@@ -11,36 +11,48 @@ Provos and David Mazieres.
Basic build instructions

1. Build it::
1. Build it (project uses rebar, but I've included a Makefile)::


2. Run it::
2. Run it (simple way, starting sasl, crypto and bcrypt)::

erl -pa ebin
erl -pa ebin -boot start_sasl -s crypto -s bcrypt

Basic usage instructions

1. Start the `sasl` and `crypto` applications::
3. Hash a password using a salt with the default number of rounds::

1> ok = application:start(sasl).
2> ok = application:start(crypto).

2. Hash a password using a salt with the default number of rounds::

4> Hash = bcrypt:hashpw("foo", bcrypt:gen_salt()).
1> {ok, Salt} = bcrypt:gen_salt(),
2> {ok, Hash} = bcrypt:hashpw("foo", Salt),

3. Verify the password::

5> Hash =:= bcrypt:hashpw("foo", Hash).
3> {ok, Hash} =:= bcrypt:hashpw("foo", Hash).
6> Hash =:= bcrypt:hashpw("bar", Hash).
4> {ok, Hash} =:= bcrypt:hashpw("bar", Hash).


The bcrypt application is configured by changing values in the
application's environment:

Sets the default number of rounds which define the complexity of the
hash function. Defaults to ``12``.

Specifies whether to use the NIF implementation (``'nif'``) or a
pool of port programs (``'port'``). Defaults to ``'port'``.

Specifies the size of the port program pool. Defaults to ``4``.


0 comments on commit e538a31

Please sign in to comment.