SHA-1 Algorithm in Windows Phone

In my Windows Phone application I need to get hash using SHA-1 Algorithm. How can I do this? For example I have string text="1234";

Answers


You would use the SHA1Managed class to compute the hash of a byte array. Probably do something like this:

var sha = new SHA1Managed(); 
var bytes = System.Text.Encoding.UTF8.GetBytes(text);
byte[] resultHash = sha.ComputeHash(bytes);

SHA1 sha = new SHA1CryptoServiceProvider(); 
byte[] result = sha.ComputeHash(System.Text.Encoding.UTF8.GetBytes(text));

You should use System.Security.Cryptography.SHA1Managed class.


Need Your Help

Google App Engine on Google Apps Domain

google-app-engine dns alias google-apps verification

I'm having trouble getting my domain pointed to my website hosted with google app engine. Here's the background... take care to separate the concepts of "google apps" (domain hosting, email, etc.) ...

Is there a way to graphically add two curves in MatLab?

matlab graphics plot

Lets say I have a sine curve and a cosine curve. Is there any way to add them graphically? Rather than doing sin + cos?