Skip to content

Instantly share code, notes, and snippets.

@dvf
Created May 19, 2019 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dvf/0f1f0610712286698183d45b3d260bf9 to your computer and use it in GitHub Desktop.
Save dvf/0f1f0610712286698183d45b3d260bf9 to your computer and use it in GitHub Desktop.
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