Skip to content

Commit

Permalink
support r14/15 crypto
Browse files Browse the repository at this point in the history
  • Loading branch information
tsloughter committed May 24, 2014
1 parent 73f21ee commit 3121c89
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
%% Compiler Options ============================================================
{erl_opts,
[{platform_define, "^[0-9]+", namespaced_types},
{platform_define, "^R1[4|5]", deprecated_crypto},
debug_info,
warnings_as_errors]}.

Expand Down
8 changes: 7 additions & 1 deletion src/ec_file.erl
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,15 @@ md5sum(Value) ->

%% @doc return an sha1sum checksum string or a binary. Same as unix utility of
%% same name.
-ifdef(deprecated_crypto).
-spec sha1sum(string() | binary()) -> string().
sha1sum(Value) ->
sha1sum(Value) ->
hex(binary_to_list(crypto:sha(Value))).
-else.
-spec sha1sum(string() | binary()) -> string().
sha1sum(Value) ->
hex(binary_to_list(crypto:hash(sha, Value))).
-endif.

%% @doc delete a file. Use the recursive option for directories.
%% <pre>
Expand Down

0 comments on commit 3121c89

Please sign in to comment.