SHAdigest (String function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
{{Template:String:SHAdigest subtitle}}
This [[Intrinsic classes|intrinsic]] function returns the 20-byte (always) binary string that is the         
This [[Intrinsic classes|intrinsic]] function returns the 20-byte (always) binary string that is the         
SHA digest of the method object string.                                                                     
SHA digest of the method object string.                                                                     
                                                                                                              
                                                                                                              
The SHAdigest function is available as of version 7.3 of the [[Sirius Mods]].                               
The SHAdigest function is available as of version 7.3 of the [[Sirius Mods]].                               
===SHAdigest syntax===     
==Syntax==
  %outStr = string:SHAdigest
{{Template:String:SHAdigest syntax}}
 
===Syntax terms===
===Syntax Terms===                                                                                        
<dl>                                                                                                         
<dl>                                                                                                         
<dt>%outStr                                                                                                 
<dt>%outStr                                                                                                 
Line 14: Line 15:
                                                                                                              
                                                                                                              
</dl>                                                                                                       
</dl>                                                                                                       
===Usage Notes===                                                                                          
==Usage notes==
*SHA (Secure Hash Algorithm) is a set of cryptographic hashing functions;  SHAdigest provides SHA-1, the most commonly used. A complete explanation of SHA hashing can easily be found on the internet.                                   
*SHA (Secure Hash Algorithm) is a set of cryptographic hashing functions;  SHAdigest provides SHA-1, the most commonly used. A complete explanation of SHA hashing can easily be found on the internet.                                   
*SHAdigest is available for use by '''''Janus SOAP''''' or '''''Janus Network Security''''' customers.       
*SHAdigest is available for use by '''''Janus SOAP''''' or '''''Janus Network Security''''' customers.       
*[[MD5digest (String function)|MD5digest]] returns the MD5 digest of the method object string, and [[RC4encrypt (String function)|RC4encrypt]] returns the RC4 encryption of the method object string.
*[[MD5digest (String function)|MD5digest]] returns the MD5 digest of the method object string, and [[RC4encrypt (String function)|RC4encrypt]] returns the RC4 encryption of the method object string.


===Examples===                                                                                             
==Examples==
                                                                                                              
                                                                                                              
The 20-byte SHA hash of a string is typically expressed as a 40-digit hex value. In the following example, the output string from the SHAdigest method is converted to hex using the [[StringToHex (String function)|StringToHex]] intrinsic method:           
The 20-byte SHA hash of a string is typically expressed as a 40-digit hex value. In the following example, the output string from the SHAdigest method is converted to hex using the [[StringToHex (String function)|StringToHex]] intrinsic method:           

Revision as of 05:14, 19 January 2011

20-byte SHA digest (String class)


This intrinsic function returns the 20-byte (always) binary string that is the SHA digest of the method object string.

The SHAdigest function is available as of version 7.3 of the Sirius Mods.

Syntax

%outString = string:SHAdigest

Syntax terms

%outStr
A string variable to receive the SHA digest of the method object string.
string
The string to which the method is applied.

Usage notes

  • SHA (Secure Hash Algorithm) is a set of cryptographic hashing functions; SHAdigest provides SHA-1, the most commonly used. A complete explanation of SHA hashing can easily be found on the internet.
  • SHAdigest is available for use by Janus SOAP or Janus Network Security customers.
  • MD5digest returns the MD5 digest of the method object string, and RC4encrypt returns the RC4 encryption of the method object string.

Examples

The 20-byte SHA hash of a string is typically expressed as a 40-digit hex value. In the following example, the output string from the SHAdigest method is converted to hex using the StringToHex intrinsic method:

   printText {'this is a simple test':shadigest:stringtohex}                       
                                                                                                           

The result (displayed on two lines) is:

   'this is a simple test':shadigest:stringtohex is BC38AA2D6769639946806616C14AF0C69477AABE

See also

List of intrinsic String methods