Created
September 16, 2025 19:54
-
-
Save HubSpotHanevold/d1d0f87ddac06472ddeee32ac39c9a9f to your computer and use it in GitHub Desktop.
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
| // Import the crypto module | |
| const crypto = require('crypto'); | |
| exports.main = async (event, callback) => { | |
| try { | |
| // Example: variable from HubSpot workflow input or event | |
| const inputValue = event.inputFields['hs_object_id']; | |
| // Create a SHA-256 hash | |
| const hash = crypto | |
| .createHash('sha256') | |
| .update(inputValue) | |
| .digest('hex'); // hex output | |
| // Return the hashed value | |
| callback({ | |
| outputFields: { | |
| hashedValue: hash | |
| } | |
| }); | |
| } catch (err) { | |
| console.error(err); | |
| throw err; | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment