예제 #1
0
        public static string Public2P2SH(string _public)
        {
            List <byte> _hash160 = new RIPEMD160Managed().ComputeHash(SHA.EncodeSHA256(HexPlus.HexStringToByteArray(_public))).ToList();

            _hash160.InsertRange(0, ((BigInteger)_hash160.Count).ToByteArray());
            _hash160.Insert(0, 0x00);
            _hash160.Insert(0, 0x16);
            _hash160.Insert(0, 0x17);
            return(BitConverter.ToString(_hash160.ToArray()).ToLower().Replace("-", ""));
        }