Created
May 19, 2019 20:20
-
-
Save dvf/0f1f0610712286698183d45b3d260bf9 to your computer and use it in GitHub Desktop.
MD5 Algorithm for Google Sheets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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