support r14/15 crypto
This commit is contained in:
parent
73f21ee770
commit
3121c892b4
2 changed files with 8 additions and 1 deletions
|
@ -10,6 +10,7 @@
|
||||||
%% Compiler Options ============================================================
|
%% Compiler Options ============================================================
|
||||||
{erl_opts,
|
{erl_opts,
|
||||||
[{platform_define, "^[0-9]+", namespaced_types},
|
[{platform_define, "^[0-9]+", namespaced_types},
|
||||||
|
{platform_define, "^R1[4|5]", deprecated_crypto},
|
||||||
debug_info,
|
debug_info,
|
||||||
warnings_as_errors]}.
|
warnings_as_errors]}.
|
||||||
|
|
||||||
|
|
|
@ -94,9 +94,15 @@ md5sum(Value) ->
|
||||||
|
|
||||||
%% @doc return an sha1sum checksum string or a binary. Same as unix utility of
|
%% @doc return an sha1sum checksum string or a binary. Same as unix utility of
|
||||||
%% same name.
|
%% same name.
|
||||||
|
-ifdef(deprecated_crypto).
|
||||||
-spec sha1sum(string() | binary()) -> string().
|
-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))).
|
hex(binary_to_list(crypto:hash(sha, Value))).
|
||||||
|
-endif.
|
||||||
|
|
||||||
%% @doc delete a file. Use the recursive option for directories.
|
%% @doc delete a file. Use the recursive option for directories.
|
||||||
%% <pre>
|
%% <pre>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue