Esempio n. 1
0
        public static string EncodePrefixed(HashType hashType, byte[] hash)
        {
            var stream = new MemoryStream();

            stream.Write(hashType.Prefix, 0, hashType.Prefix.Length);
            stream.Write(hash, 0, hash.Length);

            return(Base58Check.Encode(stream.ToArray()));
        }
Esempio n. 2
0
        public static byte[] DecodePrefixed(HashType hashType, string encoded)
        {
            var raw = Base58Check.Decode(encoded);

            var data = new byte[raw.Length - hashType.Prefix.Length];

            Array.Copy(raw, hashType.Prefix.Length, data, 0, data.Length);

            return(data);
        }