SecureString.hash(options)
Method Description |
Creates a hash for a https.SecureString. You can optionally specify the encoding used to convert the SecureString content to and the encoding used to encode the result as a string. Use https.HashAlg to set the hash algorithm. |
Returns |
|
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Since |
2015.2 |
Parameters
The options
parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
---|---|---|---|
|
string |
required |
The hash algorithm. Use values from the https.HashAlg enum. |
|
string |
optional |
Encoding used to convert/decode the current string content into binary data for hashing. Use values from the https.Encoding enum. Defaults to current internal encoding of the SecureString. Although a default is provided, we highly encourage the use of this parameter for the most secure and correct encoding. |
|
string |
optional |
Encoding used encode the binary result as a string. Use values from the https.Encoding enum. Defaults to HEX when |
Errors
Error Code |
Thrown If |
---|---|
|
An invalid attempt was made to encode the binary result to UTF-8 string. |
|
The content of the SecureString is not a valid encoded string according to the |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/https Module Script Samples.
// Add additional code
...
var secureString1 = https.createSecureString({
input: "myString1"
});
var hashString1 = secureString1.hash({
algorithm: https.HashAlg.SHA256
});
...
// Add additional code