I've created a custom field password and would like to prompt a user to input their password for certain files. In Suitescript 1.0 encrypting a password is easy as nlapiEncrypt(pass, 'sha1');
. But for Suitescript 2.0 the closest I could get to a hashed value is:
var hash = crypto.createHash(crypto.HashAlg.SHA1);
hash.update({ input: valuA, inputEncoding: encode.Encoding.UTF_8 });
var hashedVal = hash.digest({ outputEncoding: encode.Encoding.HEX });
Which is not an equal value to the custom field password. What is the correct setup for custom field password in Netsuite? And how can I get the same value of the custom field hashed password (SuiteScript 1 & 2 SHA1 produces different results)?