Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Updated README to include info about starting OTP applications
  • Loading branch information
hntrmrrs committed Aug 18, 2009
1 parent af5de62 commit e03dc2733abb13db7bd6a1594614d15a0198ccae
Showing 1 changed file with 21 additions and 10 deletions.
@@ -15,12 +15,10 @@ Basic build instructions

./bootstrap

2. Configure the project, specifying ``--with-erlang`` and
2. Configure the project, optionally specifying ``--with-erlang`` and
``--with-erl-interface``::

./configure \
--with-erlang=R12B-4/lib/erlang/usr/include \
--with-erl-interface=R12B-4/lib/erlang/lib/erl_interface-3.5.8
./configure

3. Build it

@@ -33,15 +31,28 @@ Basic build instructions
Basic usage instructions
------------------------

1. Start the `gen_server` which manages the port::
1. Start the `sasl` and `crypto` applications::

1> ok = crypto:start(),
1> {ok, Pid} = bcrypt:start_link("lib/bcrypt/bcrypt").
{ok, <0.39.0>}
1> ok = application:start(sasl).
ok
2> ok = application:start(crypto).
ok

2. Hash a password using a salt with the default number of rounds::
2. Start the `bcrypt` application::

2> bcrypt:hashpw(Pid, "foo", bcrypt:gen_salt(Pid)).
3> ok = application:start(bcrypt).
ok

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

4> Hash = bcrypt:hashpw("foo", bcrypt:gen_salt()).
"$2...000"

4. Verify the password::

5> Hash =:= bcrypt:hashpw("foo", Hash).
true
6> Hash =:= bcrypt:hashpw("bar", Hash).
false
Authors: Hunter Morris (http://skarab.com/)

0 comments on commit e03dc27

Please sign in to comment.