turn_digest_into_hex/1 renamed as bin_to_hex/1
This commit is contained in:
parent
6781f1ba6a
commit
fc69b3630c
1 changed files with 5 additions and 5 deletions
|
@ -143,22 +143,22 @@ try_write_group(To, #file_info{gid=OwnerId}) ->
|
||||||
%% named after the UNIX utility.
|
%% named after the UNIX utility.
|
||||||
-spec md5sum(string() | binary()) -> string().
|
-spec md5sum(string() | binary()) -> string().
|
||||||
md5sum(Value) ->
|
md5sum(Value) ->
|
||||||
turn_digest_into_hex(erlang:md5(Value)).
|
bin_to_hex(erlang:md5(Value)).
|
||||||
|
|
||||||
%% @doc return the SHA-1 digest of a string or a binary,
|
%% @doc return the SHA-1 digest of a string or a binary,
|
||||||
%% named after the UNIX utility.
|
%% named after the UNIX utility.
|
||||||
-ifdef(deprecated_crypto).
|
-ifdef(deprecated_crypto).
|
||||||
-spec sha1sum(string() | binary()) -> string().
|
-spec sha1sum(string() | binary()) -> string().
|
||||||
sha1sum(Value) ->
|
sha1sum(Value) ->
|
||||||
turn_digest_into_hex(crypto:sha(Value)).
|
bin_to_hex(crypto:sha(Value)).
|
||||||
-else.
|
-else.
|
||||||
-spec sha1sum(string() | binary()) -> string().
|
-spec sha1sum(string() | binary()) -> string().
|
||||||
sha1sum(Value) ->
|
sha1sum(Value) ->
|
||||||
turn_digest_into_hex(crypto:hash(sha, Value)).
|
bin_to_hex(crypto:hash(sha, Value)).
|
||||||
-endif.
|
-endif.
|
||||||
|
|
||||||
turn_digest_into_hex(Digest) ->
|
bin_to_hex(Bin) ->
|
||||||
hex(binary_to_list(Digest)).
|
hex(binary_to_list(Bin)).
|
||||||
|
|
||||||
%% @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