コード例 #1
0
ファイル: FilterLoad.cs プロジェクト: hashstream/bitcoin-lib
        public byte[] ToArray()
        {
            var woffset = 0;
            var ret     = new byte[Size];

            ret.CopyAndIncr(FilterBytes.ToArray(), ref woffset);
            ret.CopyAndIncr(Filter, ref woffset);
            ret.CopyAndIncr(BitConverter.GetBytes(HashFunctions), ref woffset);
            ret.CopyAndIncr(BitConverter.GetBytes(Tweak), woffset);

            ret[ret.Length - 1] = Flags;

            return(ret);
        }
コード例 #2
0
        public byte[] ToArray()
        {
            var ret = new byte[Size];
            var fb  = FilterBytes.ToArray();

            Buffer.BlockCopy(fb, 0, ret, 0, fb.Length);
            Buffer.BlockCopy(Filter, 0, ret, fb.Length, Filter.Length);

            var hf = BitConverter.GetBytes(HashFunctions);

            Buffer.BlockCopy(hf, 0, ret, fb.Length + Filter.Length, hf.Length);

            var tw = BitConverter.GetBytes(Tweak);

            Buffer.BlockCopy(tw, 0, ret, fb.Length + Filter.Length + hf.Length, tw.Length);

            ret[ret.Length - 1] = Flags;

            return(ret);
        }