Digest-QuickXor

 view release on metacpan or  search on metacpan

qxhash.c  view on Meta::CPAN


  return pqx;
}

void QX_add(QX* pqx, uint8_t* addData, size_t addSize) {
  // the bitvector where we'll start xoring
  size_t vectorArrayIndex = pqx->shiftSoFar / 64;

  // the position within the bit vector at which we begin xoring
  int    vectorOffset = pqx->shiftSoFar % 64;
  size_t iterations   = addSize > pqx->kWidthInBits ? pqx->kWidthInBits : addSize;

  for (size_t i = 0; i < iterations; ++i) {
    size_t nextCell         = vectorArrayIndex + 1;
    int    bitsInVectorCell = 64;
    if (nextCell == pqx->kDataLength) {
      nextCell = 0;
      if (pqx->kWidthInBits % 64 > 0) {
        bitsInVectorCell = pqx->kWidthInBits % 64;
      }
    }

    uint8_t xoredByte = 0x0;



( run in 1.475 second using v1.01-cache-2.11-cpan-71847e10f99 )