We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b35ac6e commit 6c79213Copy full SHA for 6c79213
src/rabbit_guid.erl
@@ -143,8 +143,15 @@ gen_secure() ->
143
%%
144
%% employs base64url encoding, which is safer in more contexts than
145
%% plain base64.
146
-string(G, Prefix) ->
147
- Prefix ++ "-" ++ rabbit_misc:base64url(G).
+
+-spec string(guid() | string(), any()) -> string().
148
149
+string(G, Prefix) when is_list(Prefix) ->
150
+ Prefix ++ "-" ++ rabbit_misc:base64url(G);
151
+string(G, Prefix) when is_binary(Prefix) ->
152
+ binary_to_list(Prefix) ++ "-" ++ rabbit_misc:base64url(G).
153
154
+-spec binary(guid() | string(), any()) -> binary().
155
156
binary(G, Prefix) ->
157
list_to_binary(string(G, Prefix)).
0 commit comments