Пример #1
0
        public static Byte[] ToByteArray(String s, out Byte version)
        {
            SHA256 sha256 = new SHA256Managed();

            Byte[] b    = Base58String.ToByteArray(s);
            Byte[] hash = sha256.ComputeHash(sha256.ComputeHash(b.Take(b.Length - 4).ToArray()));
            if (!hash.Take(4).SequenceEqual(b.Skip(b.Length - 4).Take(4)))
            {
                throw new ArgumentException("Invalid Base58Check String");
            }
            version = b.First();
            return(b.Skip(1).Take(b.Length - 5).ToArray());
        }