Skip to content

Instantly share code, notes, and snippets.

View VMBindraban's full-sized avatar

Vijay Bindraban VMBindraban

  • Netherlands
View GitHub Profile
var crypto = require("crypto");
function generateSecurePathHash(url, expires, secret) {
if (!url || !expires || !secret) {
return undefined;
}
var input = expires + url + " " + secret;
var binaryHash = crypto.createHash("md5").update(input).digest();
var base64Value = new Buffer(binaryHash).toString('base64');
@ksol
ksol / chrome_39.js
Last active July 10, 2021 13:37
Language detection in javascript
window.navigator.language // -> "fr"
window.navigator.languages // -> ["fr-FR", "fr", "en-US", "en", "es", "de"]
window.navigator.userLanguage // -> undefined
window.navigator.browserLanguage // -> undefined
window.navigator.systemLanguage // -> undefined