LedgerWallet.UserPin.ToBytes C# (CSharp) Method

ToBytes() public method

public ToBytes ( ) : byte[]
return byte[]
        public byte[] ToBytes()
        {
            return _Bytes.ToArray();
        }

Usage Example

示例#1
0
        internal byte[] ToBytes()
        {
            MemoryStream ms = new MemoryStream();

            ms.WriteByte((byte)OperationMode);
            ms.WriteByte((byte)DongleFeatures);
            ms.WriteByte(AcceptedP2PKHVersion);
            ms.WriteByte(AcceptedP2SHVersion);
            var bytes = UserPin.ToBytes();

            ms.WriteByte((byte)bytes.Length);
            ms.Write(bytes, 0, bytes.Length);
            bytes = SecondaryUserPin == null ? new UserPin().ToBytes() : SecondaryUserPin.ToBytes();
            ms.WriteByte((byte)bytes.Length);
            ms.Write(bytes, 0, bytes.Length);

            bytes = RestoredSeed ?? new byte[0];
            ms.WriteByte((byte)bytes.Length);
            ms.Write(bytes, 0, bytes.Length);

            bytes = RestoredWrappingKey == null ? new byte[0] : RestoredWrappingKey.ToBytes();
            ms.WriteByte((byte)bytes.Length);
            ms.Write(bytes, 0, bytes.Length);
            return(ms.ToArray());
        }
All Usage Examples Of LedgerWallet.UserPin::ToBytes