Org.BouncyCastle.Crypto.Digests.GeneralDigest.BlockUpdate C# (CSharp) Method

BlockUpdate() public method

public BlockUpdate ( byte input, int inOff, int length ) : void
input byte
inOff int
length int
return void
        public void BlockUpdate(
            byte[]  input,
            int     inOff,
            int     length)
        {
            //
            // fill the current word
            //
            while ((xBufOff != 0) && (length > 0))
            {
                Update(input[inOff]);
                inOff++;
                length--;
            }

            //
            // process whole words.
            //
            while (length > xBuf.Length)
            {
                ProcessWord(input, inOff);

                inOff += xBuf.Length;
                length -= xBuf.Length;
                byteCount += xBuf.Length;
            }

            //
            // load in the remainder.
            //
            while (length > 0)
            {
                Update(input[inOff]);

                inOff++;
                length--;
            }
        }

Usage Example

コード例 #1
0
 /// <summary>
 /// Creates a human readable fingerprint for this certificate. This fingerprint may be
 /// compared by a user with an other certificate's fingerprint to proof their equality.
 /// </summary>
 protected static string CreateFingerprint(GeneralDigest a_digestGenerator, byte[] a_data)
 {
     var digestData = new byte[a_digestGenerator.GetDigestSize()];
     a_digestGenerator.BlockUpdate(a_data, 0, a_data.Length);
     a_digestGenerator.DoFinal(digestData, 0);
     return string.Join(":", digestData.Select(x => x.ToString("X2")));
 }