summaryrefslogtreecommitdiff
path: root/src/ibrowse/ibrowse_lib.erl
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2010-11-12 14:29:00 +0000
committerFilipe David Borba Manana <fdmanana@apache.org>2010-11-12 14:29:00 +0000
commitf3329af215151bc949214fda9d44f7b9995da367 (patch)
treea9446b0b707e8d892ad7c5202d785c4f9ba82cba /src/ibrowse/ibrowse_lib.erl
parentc437600e2af0d9231a0d3b72d835f0188ff99ec9 (diff)
Yet another ibrowse fix.
Patch submitted upstream: https://github.com/cmullaparthi/ibrowse/issues/issue/20 git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1034404 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ibrowse/ibrowse_lib.erl')
-rw-r--r--src/ibrowse/ibrowse_lib.erl12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/ibrowse/ibrowse_lib.erl b/src/ibrowse/ibrowse_lib.erl
index c463c7bd..e913adbe 100644
--- a/src/ibrowse/ibrowse_lib.erl
+++ b/src/ibrowse/ibrowse_lib.erl
@@ -19,7 +19,7 @@
url_encode/1,
decode_rfc822_date/1,
status_code/1,
- dec2hex/2,
+ dec2hex/1,
drv_ue/1,
drv_ue/2,
encode_base64/1,
@@ -163,14 +163,10 @@ status_code(507) -> insufficient_storage;
status_code(X) when is_list(X) -> status_code(list_to_integer(X));
status_code(_) -> unknown_status_code.
-%% @doc dec2hex taken from gtk.erl in std dist
-%% M = integer() -- number of hex digits required
+%% @doc Returns a string with the hexadecimal representation of a given decimal.
%% N = integer() -- the number to represent as hex
-%% @spec dec2hex(M::integer(), N::integer()) -> string()
-dec2hex(M,N) -> dec2hex(M,N,[]).
-
-dec2hex(0,_N,Ack) -> Ack;
-dec2hex(M,N,Ack) -> dec2hex(M-1,N bsr 4,[d2h(N band 15)|Ack]).
+%% @spec dec2hex(N::integer()) -> string()
+dec2hex(N) -> lists:flatten(io_lib:format("~.16B", [N])).
%% @doc Implements the base64 encoding algorithm. The output data type matches in the input data type.
%% @spec encode_base64(In) -> Out