Print

Zoho Deluge - MD5 function

What?
So this is NOT an article on how to create a MD5 function for an ETag in Zoho Deluge as I expected it would be. At time of print, the Zoho documentation (and Google search results) make no mention of using MD5 in an encryption task.

Why?
I'm trying to create an ETag for a synchronization process between Zoho Creator and Zoho CRM. Combining all the fields to compare into a single field can't be done via the documented methods (base64, urlencode or AES) as this exceeds 255 characters (it could be a multiline but this would defeat the objective of an Etag).

How?
Well I was going to document writing a Creator function but found a shortcut playing with the base64encode function:
copyraw
v_Etag = zoho.encryption.base64encode(v_Combined_Fields);

// returns error 
Error on Execution
Execution Failed
	 Due to invalid expressions insert statement is terminated	Line:(102)
	 Value of the field Etag length should be lesser than or equal to MaxLength 255.	Line:(132)
  1.  v_Etag = zoho.encryption.base64encode(v_Combined_Fields)
  2.   
  3.  // returns error 
  4.  Error on Execution 
  5.  Execution Failed 
  6.       Due to invalid expressions insert statement is terminated    Line:(102) 
  7.       Value of the field Etag length should be lesser than or equal to MaxLength 255.    Line:(132) 

It's not in the documentation but wouldn't it be nice if you could just replace the base64encode function with an MD5 function, like so:
copyraw
v_Etag = zoho.encryption.md5(v_Combined_Fields);

// WORKS! Returns a hexadecimal 32 character string
  1.  v_Etag = zoho.encryption.md5(v_Combined_Fields)
  2.   
  3.  // WORKS! Returns a hexadecimal 32 character string 

Arguably, I'm using Creator 5 and the documentation for the encryption tasks are for Creator v4. However search md5 in zoho creator v5 help documentation and it's never heard of md5 (absolutely no results)!
Category: Zoho :: Article: 657