/**
* Generates the SHA-256 hash of a string using modern JavaScript (ES6+).
*
* @param {string} inputString The string to hash.
* @return {string} The SHA-256 hash as a hexadecimal string.
*/
function generateSHA256(inputString) {
const bytes = Utilities.computeDigest(Utilities.DigestAlgorithm.SHA_256, inputString);
const hash = bytes.map(byte => (byte + 256).toString(16).slice(-2)).join('');
return hash;
}