Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

What is the replacement of GlideChecksum in scoped applications?

andriyko
Giga Contributor

How can I calculate md5 checksum in ServiceNow?

var chsum = new GlideChecksum("mystring");

gs.info(chsum.getMD5());

GlideChecksum is not allowed in scoped applications

3 REPLIES 3

coryseering
ServiceNow Employee
ServiceNow Employee

Hi Andriy,



There is no replacement for GlideChecksum in Scoped Applications at this time. You can open an Enchancement Request on Hi to request that a scoped version be made available in a future release.



In the mean time, there are several Javascript MD5 hash generators. You can import one as a Script Include in your Scoped App, and use it in place of GlideChecksum.



https://stackoverflow.com/questions/14733374/how-to-generate-md5-file-hash-on-javascript


https://stackoverflow.com/questions/1655769/fastest-md5-implementation-in-javascript


https://stackoverflow.com/questions/6818214/erlang-and-javascript-md5-digest-match


Thanks Cory.


You can import one as a Script Include in your Scoped App, and use it in place of GlideChecksum.


This is what I actually did. But I would like to rely on SN built-in solutions.


Peter Bell
ServiceNow Employee
ServiceNow Employee

You can use GlideDigest which works in scoped apps:

 

var digest = new GlideDigest();
gs.info(digest.getMD5Hex('Hello'));