I'd like hash the user ids I send from local storage to 3P tools/partners from Google Tag Manager. Here's the JavaScript I have written (unhashed). How do I hash this using sha256?
function() {
try {
return localStorage.getItem('__user_id').replace(/["']/g, "");
}catch(e) {
return "";
}
}
Hello and welcome to the community, I think in your position, you may find this helpful: Are there any SHA-256 javascript implementations that are generally considered trustworthy?