Skip to content

Instantly share code, notes, and snippets.

@dvf

dvf/MD5.js

Created May 19, 2019
Embed
What would you like to do?
MD5 Algorithm for Google Sheets
function MD5 (input) {
var digest = Utilities.computeDigest(Utilities.DigestAlgorithm.MD5, input);
var output = "";
for (i = 0; i < digest.length; i++) {
var h = digest[i];
if (h < 0) { h += 256; }
if (h.toString(16).length == 1) { output += '0'; }
output += h.toString(16);
}
return output;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment