/// <Summary> /// create an object by using the new operator /// <summary> /// <param name = "strSource"> plaintext to be encrypted </param> /// <returns> returns the 16-bit encryption result, the result is a 32-bit encryption result with 9th to 25 digits </returns> public string SHA1EncryptData (string strSource) {// new System. security. cryptography. SHA1 sha = new System. security. cryptography. SHA1CryptoServiceProvider (); // obtain the ciphertext byte array byte [] bytResult = sha. computeHash (System. text. encoding. default. getBytes (strSource); // convert it to a string and take 9 to 25 digits. // string strResult = BitConverter. toString (bytResult, 4, 8); // converts the string to a 32-Bit string strResult = BitConverter. toString (bytResult); // The character string converted by BitConverter will generate a separator between each character. strResult = strResult must be removed. replace ("-", ""); return strResult ;}