Home

C# Hash SHA512 Simple Dirty

protected string MyHash(string fromthis)

{

string thishash = "";

using (SHA512 mysham = SHA512.Create())

{

byte[] mybytes = System.Text.Encoding.UTF8.GetBytes(fromthis);

thishash = Convert.ToBase64String(mysham.ComputeHash(mybytes));

thishash = thishash.Replace("=", "");

}

return thishash;

}

It's not clever. It's not salted. For real thorough password storage you'd be wanting to sprinkle some salt in with this lot. Buuuut. It's a hand way to get a random string. 

Reader's Comments

JT said :-
Handy. Nice n simple
02/18//2019 11:55:49 UTC

Post Your Comment Posts/Links Rules

Name

Comment

Add a RELEVANT link (not required)

Upload an image (not required)

No uploaded image
Real person number
Please enter the above number below




Home
Admin Ren's Biking Blog