Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Security.Cryptography; // Importing the hash algoritm PUT THIS WITH THE OTHER USINGS IN YOUR CODE !!!!
- private string passToHash(string pass)
- {
- // Creating the hash algorithm
- HashAlgorithm algorithm = MD5.Create();
- // Creating the output from the hash in bytes
- byte[] hash = algorithm.ComputeHash(Encoding.UTF8.GetBytes(pass));
- // converting bytes in hash to string
- StringBuilder sb = new StringBuilder();
- foreach (byte b in hash)
- {
- sb.Append(b.ToString("X2")); // X2 makes it an uppercase hexadecimal character
- }
- return sb.ToString();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement