dlech.SshAgentLib.BlobBuilder.AddBigIntBlob C# (CSharp) Метод

AddBigIntBlob() публичный Метод

Adds BigInteger to builder prefixed with size
public AddBigIntBlob ( BigInteger aBigInt ) : void
aBigInt Org.BouncyCastle.Math.BigInteger
Результат void
        public void AddBigIntBlob(BigInteger aBigInt)
        {
            byte[] bytes = aBigInt.ToByteArray();
              AddBlob(bytes);
        }

Usage Example

Пример #1
0
 public void TestAddBigInt()
 {
     BlobBuilder builder = new BlobBuilder();
       BigInteger value = new BigInteger("12398259028592293582039293420948023");
       builder.AddBigIntBlob(value);
       byte[] valueBytes = value.ToByteArrayUnsigned();
       //Assert.That(valueBytes[0], Is.EqualTo(0));
       byte[] expected = new byte[valueBytes.Length + 4];
       Array.Copy(valueBytes.Length.ToBytes(), expected, 4);
       Array.Copy(valueBytes, 0, expected, 4, valueBytes.Length);
       Assert.That(builder.GetBlob(), Is.EqualTo(expected));
 }
All Usage Examples Of dlech.SshAgentLib.BlobBuilder::AddBigIntBlob