Google Forms add-on that generates codes upon form submission. This add-on was borne of my need to establish a quiz as a pre-requisite to filling out a second form.
Now available through the GSuite Marketplace. Need to verify these codes? See the section #Verification
below.
Form Code Generator was created for lightweight use cases only. It should not be used for complex or important workflows, as the security of these hash codes are not generated per state-of-the-art standards (e.g., does not support nonce values).
Disclaimer: I used plenty of code from Google Form Add-on’s original tutorial. In several cases, I even left Google’s original copyright notice.
In effect, I use an MD5
hash combining the user’s email address, a salt the user sets, and a fixed random string to prevent rainbow tables.
If the Form Code Generator auth is not working, but you still want to generate codes, just skip step 1 below.
ctrl+s
or cmd+s
)function MD5 (input) {
var rawHash = Utilities.computeDigest(Utilities.DigestAlgorithm.MD5, input);
var txtHash = '';
for (i = 0; i < rawHash.length; i++) {
var hashVal = rawHash[i];
if (hashVal < 0) {
hashVal += 256;
}
if (hashVal.toString(16).length == 1) {
txtHash += '0';
}
txtHash += hashVal.toString(16);
}
return txtHash;
}
C
. Then, add the following code to any cell, to generate the code for the response in row 2:=MD5(C2+YOUR_SALT + "dEstr0yR@1nB0wTAb1es”)
Make sure to replace YOUR_SALT
. See the example spread for sample usage; the script for this spread, reproduced in the code block above, can be found here.
See the full Privacy Policy.