summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/request/node_modules/hawk/lib/crypto.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/request/node_modules/hawk/lib/crypto.js')
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/hawk/lib/crypto.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/deps/npm/node_modules/request/node_modules/hawk/lib/crypto.js b/deps/npm/node_modules/request/node_modules/hawk/lib/crypto.js
index 150340a336..9825c7d88f 100755
--- a/deps/npm/node_modules/request/node_modules/hawk/lib/crypto.js
+++ b/deps/npm/node_modules/request/node_modules/hawk/lib/crypto.js
@@ -109,3 +109,10 @@ exports.calculateTsMac = function (ts, credentials) {
return hmac.digest('base64');
};
+
+exports.timestampMessage = function (credentials, localtimeOffsetMsec) {
+
+ var now = Math.floor((Utils.now() + (localtimeOffsetMsec || 0)) / 1000);
+ var tsm = exports.calculateTsMac(now, credentials);
+ return { ts: now, tsm: tsm };
+};