MD5Hash Calculation

kailashthiyagar
Kilo Guru

I m looking forward for an example of how to calculate MD5Hash in scope application. It sounds like GlideCheckSum function is one option to calculate MD5Hash but it wont work in Scoped Application it seems. Another option would be to import an external js library and calculate MD5Hash using that.

I m not sure which one to be used and also i dont have an experience of importing js library in Service now and using it. Could someone help me on this?

5 REPLIES 5

gauravchoudhury
Tera Guru

Hi Kailash,



There is way to perform this in SN. Actually, there is a hidden class in SN for this. That class is "GlideChecksum". This class is implementation of checksum.java class.



Source: Link



Please Note: In Geneva, the calculateMD5CheckSum method of the GlideChecksum class used below is not accessible unless you submit a ticket to ServiceNow, requesting that it be whitelisted. Unfortunately, this is the only way to calculate an MD5 checksum using native functionality in ServiceNow Geneva. It should work in earlier versions, though. (Source: Link)


will that work in scoped application?


Hi Kailash,



Although, I haven't tried this specifically, you might want to give it a try and see if it works in a scoped application.


asifnoor
Kilo Patron

I am using Jakarta release and i am still facing this issue. Any idea how to use this.

 

java.lang.SecurityException: Illegal access to method calculateMD5CheckSum(com.glide.ui.SysAttachmentInputStream) in class com.glide.util.Checksum