Talk:Direct Delivery and Automatic Notification System

From Second Life Wiki
Revision as of 17:10, 23 September 2012 by Antonius Frentis (talk | contribs) (Alternative .NET validation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Regarding the .NET example for the ANS verification, the use of FormsAuthentication.HashPasswordForStoringInConfigFile() is somewhat unorthodox but it's a single call and it works. For an alternative I offer the following:

 
string calcHash;
System.Security.Cryptography.SHA1Managed hashAlgorithm = new System.Security.Cryptography.SHA1Managed();
System.Text.ASCIIEncoding encoder = new System.Text.ASCIIEncoding();
byte[] bytes = encoder.GetBytes(Request.Url.Query.Remove(0,1) + saltCode);
bytes = hashAlgorithm.ComputeHash(bytes);
calcHash = BitConverter.ToString(bytes).Replace("-","").ToLowerInvariant();

Antonius Frentis 18:10, 23 September 2012 (PDT)