Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Remove b64 function.
  • Loading branch information
Tim Fletcher committed Nov 6, 2008
1 parent b5ee272 commit e8287b3a6f34f8fbba016c63a6d4e33e49ca7f62
Showing 1 changed file with 2 additions and 4 deletions.
@@ -8,7 +8,8 @@
signature({Method, URL, Params}, ConsumerSecret, TokenSecret) ->
signature(base_string(Method, URL, Params), ConsumerSecret, TokenSecret);
signature(BaseString, ConsumerSecret, TokenSecret) ->
b64(crypto:sha_mac(key(ConsumerSecret, TokenSecret), BaseString)).
Key = key(ConsumerSecret, TokenSecret),
base64:encode_to_string(crypto:sha_mac(Key, BaseString)).

base_string(Method, URL, Params) when is_list(Method) ->
Unencoded = [Method, oauth_uri:normalize(URL), normalize(Params)],
@@ -23,9 +24,6 @@ sort(Params) ->
key(ConsumerSecret, TokenSecret) ->
fmt:sprintf("%s&%s", [percent_encode(ConsumerSecret), percent_encode(TokenSecret)]).

b64(Data) ->
base64:encode_to_string(Data).

to_string({K, V}) when is_atom(K) ->
{atom_to_list(K), V};
to_string({K, V}) when is_list(K) ->

0 comments on commit e8287b3

Please sign in to comment.