Scriptlet: Sample Hash Function

Use ion's JavaScript interpreter to combine and encrypt data so that it's available for data export. The sample below performs SHA1 encryption on an API key combined with a piece of respondent data. The hashed value is then saved into a ion data collection field so that it's available for export or inclusion in data-pass script.

// returns encrypted value of sample API key + respondent data                   
// value saves into sample LiveBall data collection field called "LB_hash"       
var samplehash = cryptoSHA1('112233' + respondent.dataname);