System.Security.Cryptography.SHA1Internal.HashCore C# (CSharp) Method

HashCore() public method

public HashCore ( byte rgb, int ibStart, int cbSize ) : void
rgb byte
ibStart int
cbSize int
return void
		public void HashCore (byte[] rgb, int ibStart, int cbSize) 
		{
			int i;

			if (_ProcessingBufferCount != 0) {
				if (cbSize < (BLOCK_SIZE_BYTES - _ProcessingBufferCount)) {
					System.Buffer.BlockCopy (rgb, ibStart, _ProcessingBuffer, _ProcessingBufferCount, cbSize);
					_ProcessingBufferCount += cbSize;
					return;
				}
				else {
					i = (BLOCK_SIZE_BYTES - _ProcessingBufferCount);
					System.Buffer.BlockCopy (rgb, ibStart, _ProcessingBuffer, _ProcessingBufferCount, i);
					ProcessBlock (_ProcessingBuffer, 0);
					_ProcessingBufferCount = 0;
					ibStart += i;
					cbSize -= i;
				}
			}

			for (i = 0; i < cbSize - cbSize % BLOCK_SIZE_BYTES; i += BLOCK_SIZE_BYTES) {
				ProcessBlock (rgb, (uint)(ibStart + i));
			}

			if (cbSize % BLOCK_SIZE_BYTES != 0) {
				System.Buffer.BlockCopy (rgb, cbSize - cbSize % BLOCK_SIZE_BYTES + ibStart, _ProcessingBuffer, 0, cbSize % BLOCK_SIZE_BYTES);
				_ProcessingBufferCount = cbSize % BLOCK_SIZE_BYTES;
			}
		}
	

Usage Example

 protected override void HashCore(byte[] rgb, int ibStart, int cbSize)
 {
     State = 1;
     sha.HashCore(rgb, ibStart, cbSize);
 }
All Usage Examples Of System.Security.Cryptography.SHA1Internal::HashCore