developer:soap-1.4:objects:uehash

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
developer:soap-1.4:objects:uehash [2010/09/10 15:05]
irina
developer:soap-1.4:objects:uehash [2011/05/10 09:28]
irina
Line 31: Line 31:
    
   ' The source key and pin are created by the merchant ​   ' The source key and pin are created by the merchant ​
-  sourcekey = "e42SYc86C4uvlvyP62ow54Kv93SZsJVm"+  sourcekey = "Your_source_key_here"
   pin = "​1234"​   pin = "​1234"​
    
Line 71: Line 71:
 ==== .NET C# ==== ==== .NET C# ====
 <code c> <code c>
-string pin "​1234"​;+            MD5 md5Hasher ​MD5.Create();
  
-            // Instantiate Hash +            // Convert the input string to a byte array and compute the hash. 
-            ​usaepay.ueHash hash new usaepay.ueHash(); +            ​byte[] data md5Hasher.ComputeHash(Encoding.Default.GetBytes(input));
-            hash.Type = "​md5"; ​ // Type of encryption  +
-            hash.Seed = Guid.NewGuid().ToString();  // unique encryption seed+
  
-            // Assemble string and hash +            // Create a new Stringbuilder to collect the bytes 
-            ​string prehashvalue = string.Concat(token.SourceKey,​ hash.Seed, pin); +            ​// and create a string. 
-            ​hash.HashValue ​GenerateHash(prehashvalue);+            ​StringBuilder sBuilder ​new StringBuilder();
  
-            // Add hash to token +            // Loop through each byte of the hashed data  
-            ​token.PinHash ​hash;+            ​// and format each one as a hexadecimal string. 
 +            for (int i 0; i < data.Length;​ i++) 
 +            { 
 +                sBuilder.Append(data[i].ToString("​x2"​));​ 
 +            } 
 + 
 +            // Return the hexadecimal string. 
 +            return sBuilder.ToString();
 </​code>​ </​code>​
  
developer/soap-1.4/objects/uehash.txt · Last modified: 2011/05/10 09:28 by irina

Page Tools