PageRenderTime 27ms CodeModel.GetById 18ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 1ms

/modules/mod_oauth/deps/erlang-oauth/src/oauth_hmac_sha1.erl

https://code.google.com/p/zotonic/
Erlang | 11 lines | 7 code | 4 blank | 0 comment | 0 complexity | 5280775c76fb567bdea84a0ff5debf8f MD5 | raw file
 1-module(oauth_hmac_sha1).
 2
 3-export([signature/3, verify/4]).
 4
 5
 6signature(BaseString, CS, TS) ->
 7  Key = oauth_uri:calate("&", [CS, TS]),
 8  base64:encode_to_string(crypto:sha_mac(Key, BaseString)).
 9
10verify(Signature, BaseString, CS, TS) ->
11  Signature =:= signature(BaseString, CS, TS).