aboutsummaryrefslogtreecommitdiff
path: root/src/jlib.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/jlib.erl')
-rw-r--r--src/jlib.erl9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/jlib.erl b/src/jlib.erl
index 1ee2e4ffa..4fd897599 100644
--- a/src/jlib.erl
+++ b/src/jlib.erl
@@ -59,7 +59,8 @@
now_to_local_string/1,
datetime_string_to_timestamp/1,
decode_base64/1,
- encode_base64/1]).
+ encode_base64/1,
+ ip_to_list/1]).
-include("jlib.hrl").
@@ -676,3 +677,9 @@ e(X) when X>51, X<62 -> X-4;
e(62) -> $+;
e(63) -> $/;
e(X) -> exit({bad_encode_base64_token, X}).
+
+%% Convert Erlang inet IP to list
+ip_to_list({IP, _Port}) ->
+ ip_to_list(IP);
+ip_to_list({A,B,C,D}) ->
+ lists:flatten(io_lib:format("~w.~w.~w.~w",[A,B,C,D])).