public BitReader(byte[] data, int bitCount) { var writer = new BitWriter(); writer.Write(data, bitCount); _array = writer.ToBitArray(); }
public PartialMerkleTree(uint256[] vTxid, bool[] vMatch) { if (vMatch.Length != vTxid.Length) { throw new ArgumentException("The size of the array of txid and matches is different"); } TransactionCount = (uint)vTxid.Length; var root = MerkleNode.GetRoot(vTxid); var flags = new BitWriter(); MarkNodes(root, vMatch); BuildCore(root, flags); Flags = flags.ToBitArray(); }
public static int[] ToIntegers(this BitWriter writer) { var array = writer.ToBitArray(); return(WordList.ToIntegers(array)); }