1
0
Fork 0
mirror of git://git.psyced.org/git/psyced synced 2024-08-15 03:25:10 +00:00
psyced/world/net/library/hmac.c

14 lines
331 B
C
Raw Normal View History

#include <net.h>
inherit NET_PATH "library/base64";
#include HTTP_PATH "library.i"
string hmac_bin(int method, string key, string arg) {
return regreplace(hmac(method, key, arg), "..", #'xx2c, 1); //'
}
string hmac_base64(int method, string key, string arg) {
return encode_base64((int *)hmac_bin(method, key, arg));
}