Narzędzia użytkownika

Narzędzia witryny


c-sharp-md5

To jest stara wersja strony!


Funkcja MD5

        public string md5(string napis)
        {
            System.Text.UTF8Encoding ue = new System.Text.UTF8Encoding();
            byte[] bytes = ue.GetBytes(napis);

            // encrypt bytes
            System.Security.Cryptography.MD5CryptoServiceProvider md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
            byte[] hashBytes = md5.ComputeHash(bytes);

            // Convert the encrypted bytes back to a string (base 16)
            string hashString = "";

            for (int i = 0; i < hashBytes.Length; i++)
            {
                hashString += Convert.ToString(hashBytes[i], 16).PadLeft(2, '0');
            }
            return (hashString.PadLeft(32, '0'));
        }
c-sharp-md5.1364302078.txt.gz · ostatnio zmienione: 2018/07/16 11:47 (edycja zewnętrzna)