- Page: https://fb.com/CodeBangkok
- Group: https://fb.com/groups/msdevth
- Blog: https://dev.to/CodeBangkok
- YouTube: https://youtube.com/CodeBangkok
- GitHub: https://github.com/CodeBangkok
function hash(input) {
var rawHash = Utilities.computeDigest(Utilities.DigestAlgorithm.SHA_1,input);
var txtHash = '';
for (j = 0; j < rawHash.length; j ++){
var hashVal = rawHash[j];
if (hashVal<0)
hashVal += 256;
if (hashVal.toString(16).length == 1)
txtHash +="0";
txtHash += hashVal.toString(16);
}
return txtHash;
}