The Web Crypto API is a newer JS standard api to enable secure application development within JS environments with standard cryptographic APIS. However, it seems to not be usable within retool transformers, or js queries.
I am trying to access the built-in browser primitive for generating hashes. I want to use a users email hash as the seed for a consistent random sort. According to the MDN docs for generating a hash, I should be able to do something like below, but the following code is unsupported in a retool transformer:
const email = {{ current_user.email }}
async function digestMessage(message) {
const encoder = new TextEncoder();
const data = encoder.encode(message);
const hash = await crypto.subtle.digest("SHA-256", data);
return hash;
}
return digestMessage(email)
Could this API be enabled within retool, or documentation provided on how to use it within the retool context?