Convert string to MD5 hash

Code
public static str str2MD5Hash(str _input)
{
    
CLRObject                      clrMD5;
    
System.Text.Encoding           clrEncoding;
    
CLRObject                      inputByteArray;
    
CLRObject                      hashByteArray;
    
System.Collections.IEnumerator clrEnumerator;
    
CLRObject                      clrArrayElement;
    
str                            ret;
    
    
void CLRErrorsToInfolog()
    {
        
System.Exception e CLRInterop::getLastException();

        while(
e)
        {
            
Error(e.get_Message());
            
e.get_InnerException();
        }
    }

    new 
InteropPermission(InteropKind::ClrInterop).assert();

    try
    {
        
clrMD5         System.Security.Cryptography.MD5::Create();
        
clrEncoding    System.Text.Encoding::get_UTF8();
        
inputByteArray clrEncoding.GetBytes(_input);
        
hashByteArray  clrMD5.ComputeHash(inputByteArray);
        
clrEnumerator  hashByteArray.GetEnumerator();

        while (
clrEnumerator.MoveNext())
        {
            
clrArrayElement clrEnumerator.get_Current();
            
ret            += CLRInterop::getAnyTypeForObject(clrArrayElement.ToString('X2'));
        }
    }
    catch (
Exception::CLRError)
    {
        
CLRErrorsToInfolog();
    }

    return 
ret;
}
AX versionMicrosoft Dynamics AX 4.0
PropertiesCreated by Alex 2015-02-03 13:37:45 (Public)
TagsCrypt Encryption