Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
When making a release, the bcrypt application directory does not cont…
…ain an 'ebin' directory (it is in the .ez file), so "ebin/../priv" cannot be used to find the driver. Instead, use another call to filename:dirname/1 to go up one more directory.

Also fix a small edoc annotation problem for bcrypt:hash/2.
  • Loading branch information
James Lee committed Feb 26, 2011
1 parent 30d63cd commit b2fecac2e50032a486c05e86f47bd147f007ed39
Showing 1 changed file with 2 additions and 2 deletions.
@@ -37,7 +37,7 @@
%% @end
%%--------------------------------------------------------------------
init() ->
Path = filename:join([filename:dirname(code:which(?MODULE)),"..","priv",?MODULE]) ++ "_drv",
Path = filename:join([filename:dirname(filename:dirname(code:which(?MODULE))),"priv",?MODULE]) ++ "_drv",
case filelib:is_file(Path ++ ".so") of
true -> erlang:load_nif(Path, 0);
false ->
@@ -81,7 +81,7 @@ encode_salt(_R, _LogRounds) ->
%%--------------------------------------------------------------------
%% @doc Hash the specified password and the salt using the OpenBSD
%% Blowfish password hashing algorithm. Returns the hashed password.
%% @spec hashpw(Password::binary(), Salt::binary()) -> string()
%% @spec hash(Password::binary(), Salt::binary()) -> string()
%% @end
%%--------------------------------------------------------------------
hash(Password, Salt) when is_binary(Password), is_binary(Salt) ->

0 comments on commit b2fecac

Please sign in to comment.