LedgerWallet.BufferUtils.WriteUint32BE C# (CSharp) Method

WriteUint32BE() static private method

static private WriteUint32BE ( System data, long index ) : void
data System
index long
return void
        internal static void WriteUint32BE(System.IO.Stream data, long index)
        {
            var bytes = Utils.ToBytes((uint)index, false);
            data.Write(bytes, 0, bytes.Length);
        }

Usage Example

        public byte[] UntrustedHashSign(KeyPath keyPath, UserPin pin, LockTime lockTime, SigHash sigHashType)
        {
            MemoryStream data = new MemoryStream();

            byte[] path = Serializer.Serialize(keyPath);
            BufferUtils.WriteBuffer(data, path);

            var pinBytes = pin == null ? new byte[0] : pin.ToBytes();

            data.WriteByte((byte)pinBytes.Length);
            BufferUtils.WriteBuffer(data, pinBytes);
            BufferUtils.WriteUint32BE(data, (uint)lockTime);
            data.WriteByte((byte)sigHashType);
            return(CreateAPDU(LedgerWalletConstants.LedgerWallet_CLA, LedgerWalletConstants.LedgerWallet_INS_HASH_SIGN, (byte)0x00, (byte)0x00, data.ToArray()));
        }
All Usage Examples Of LedgerWallet.BufferUtils::WriteUint32BE