Esempio n. 1
0
        } //compute hash from arguments and return hash value as string

        private static string GetRIPEMD160Hash(string text)
        {
            //create variables for computing hash and making it a string
            UnicodeEncoding UniCode = new UnicodeEncoding();

            byte[]    HashResult;
            byte[]    msg        = UniCode.GetBytes(text);
            RIPEMD160 hashString = RIPEMD160Managed.Create();
            string    Str        = "";

            //compute hash with RIPEMD160 module and format output as string
            //convert bytes in HashResult to string values
            HashResult = hashString.ComputeHash(msg);
            foreach (byte x in HashResult)
            {
                Str += String.Format("{0:x2}", x);
            }

            //clear excess resource usage
            hashString.Clear();
            return(Str);
        } //compute hash from arguments and return hash value as string