GlideDigest - Scoped

concept australia Updated Sep 10, 2026 3 min read c_GlideDigestScopedAPI.md
Raw file servicenow.com

The scoped GlideDigest class provides methods for creating a message digest from strings or input streams using MD5, SHA1, or SHA256 hash algorithms.

Parent Topic:Server API reference

GlideDigest - GlideDigest()

Creates an instance of scoped GlideDigest.

Name Type Description
None

GlideDigest - getMD5Base64(String source)

Creates a message digest from a string using the MD5 algorithm. The output string is in Base64.

Name Type Description
source String The source string.
Type Description
String The message digest.
JavaScript
var inputString = "Her molasses flowed slowly down the hill.";var digest = new GlideDigest();gs.info(digest.getMD5Base64(inputString));

GlideDigest - getMD5Base64FromInputStream( GlideScriptableInputStream inputStream)

Creates a message digest from an input stream using the MD5 algorithm. The output string is in Base64.

Name Type Description
inputStream GlideScriptableInputStream The source input stream.
Type Description
String The message digest.
JavaScript
var inputStream = new GlideSysAttachment().getContentStream(attachmentSysID);var digest = new GlideDigest();gs.info(digest.getMD5Base64FromInputStream(inputStream));

GlideDigest - getMD5Hex(String source)

Creates a message digest from a string using the MD5 algorithm. The output string is in hexadecimal.

Name Type Description
source String The source string.
Type Description
String The message digest.
JavaScript
var inputString = "Her molasses flowed slowly down the hill.";var digest = new GlideDigest();gs.info(digest.getMD5Hex(inputString));

GlideDigest - getMD5HexFromInputStream( GlideScriptableInputStream inputStream)

Creates a message digest from an input stream using the MD5 algorithm. The output string is in hexadecimal.

Name Type Description
inputStream GlideScriptableInputStream The source input stream.
Type Description
String The message digest.
JavaScript
var inputStream = new GlideSysAttachment().getContentStream(attachmentSysID);var digest = new GlideDigest();gs.info(digest.getMD5HexFromInputStream(inputStream));

GlideDigest - getSHA1Base64(String source)

Creates a message digest from a string using the SHA1 algorithm. The output string is in Base64.

Name Type Description
source String The source string.
Type Description
String The message digest.
JavaScript
var inputString = "Her molasses flowed slowly down the hill.";var digest = new GlideDigest();gs.info(digest.getSHA1Base64(inputString));

GlideDigest - getSHA1Base64FromInputStream( GlideScriptableInputStream inputStream)

Creates a message digest from an input stream using the SHA1 algorithm. The output string is in Base64.

Name Type Description
inputStream GlideScriptableInputStream The source input stream.
Type Description
String The message digest.
JavaScript
var inputStream = new GlideSysAttachment().getContentStream(attachmentSysID);var digest = new GlideDigest();gs.info(digest.getSHA1Base64FromInputStream(inputStream));

GlideDigest - getSHA1Hex(String source)

Creates a message digest from a string using the SHA1 algorithm. The output string is in hexadecimal.

Name Type Description
source String The source string.
Type Description
String The message digest.
JavaScript
var inputString = "Her molasses flowed slowly down the hill.";var digest = new GlideDigest();gs.info(digest.getSHA1Hex(inputString));

GlideDigest - getSHA1HexFromInputStream( GlideScriptableInputStream inputStream)

Creates a message digest from an input stream using the SHA1 algorithm. The output string is in hexadecimal.

Name Type Description
inputStream GlideScriptableInputStream The source input stream.
Type Description
String The message digest.
JavaScript
var inputStream = new GlideSysAttachment().getContentStream(attachmentSysID);var digest = new GlideDigest();gs.info(digest.getSHA1HexFromInputStream(inputStream));

GlideDigest - getSHA256Base64(String source)

Creates a message digest from a string using the SHA256 algorithm. The output string is in Base64.

Name Type Description
source String The source string.
Type Description
String The message digest.
JavaScript
var inputString = "Her molasses flowed slowly down the hill.";var digest = new GlideDigest();gs.info(digest.getSHA256Base64(inputString));

GlideDigest - getSHA256Base64FromInputStream( GlideScriptableInputStream inputStream)

Creates a message digest from an input stream using the SHA256 algorithm. The output string is in Base64.

Name Type Description
inputStream GlideScriptableInputStream The source input stream.
Type Description
String The message digest.
JavaScript
var inputStream = new GlideSysAttachment().getContentStream(attachmentSysID);var digest = new GlideDigest();gs.info(digest.getSHA256Base64FromInputStream(inputStream));

GlideDigest - getSHA256Hex(String source)

Creates a message digest from a string using the SHA256 algorithm. The output string is in hexadecimal.

Name Type Description
source String The source string.
Type Description
String The message digest.
JavaScript
var inputString = "Her molasses flowed slowly down the hill.";var digest = new GlideDigest();gs.info(digest.getSHA256Hex(inputString));

GlideDigest - getSHA256HexFromInputStream( GlideScriptableInputStream inputStream)

Creates a message digest from an input stream using the SHA256 algorithm. The output string is in hexadecimal.

Name Type Description
inputStream GlideScriptableInputStream The source input stream.
Type Description
String The message digest.
JavaScript
var inputStream = new GlideSysAttachment().getContentStream(attachmentSysID);var digest = new GlideDigest();gs.info(digest.getSHA256HexFromInputStream(inputStream));
Search documentation
Search document titles and file paths on the australia branch