Two hash encryption algorithms: MD5, SHA1. Case Sensitive

xiaoxiao2021-03-06  93

I thought this is everyone know, so I didn't send it. I had a netizen asking me that many entry did actually need. Send it to the entry.

// It turns out in a webservice so there is a string of the back [WebMethod (Description = "provides two hash encryption algorithms: MD5, SHA1. Sensitive.")]]

Public String Encryptpassword (String PasswordString, String PasswordFormat)

{

String result = "";

Switch (PasswordFormat)

{

Case "SHA1":

Result = formsauthentication.hashpasswordforstoringInconfigfile (PasswordString, "SHA1");

Break;

Case "MD5":

Result = Formsauthentication.hashPasswordforstoringInconfigfile (PasswordString, "MD5");

Break;

DEFAULT:

Result = "";

Break;

}

Return Result;

}

转载请注明原文地址:https://www.9cbs.com/read-105693.html

New Post(0)