retroluxury/etc/luai/image.c
static uint32_t crc32( const void* data, int len )
{
  uint8_t* data_stream = ( uint8_t* )data;
  uint32_t crc = 0xedb88320U;

  if ( len <= 0 || data == 0 )
  {
    return 0;
  }

  while ( len )
  {
    uint8_t byte = *data_stream++;
    crc = ( crc >> 8 ) ^ s_crc32[ byte  ^ ( crc & 0xff ) ];
    len--;
  }

  return crc;
}
/*-----------------------------------------------------------------------------
Return a 32-bit crc for the given data block
-----------------------------------------------------------------------------*/
Return a 32-bit crc for the given data block
Return a 32 - bit crc for the given data block
static uint32_t crc32( const void* data, int len )
{
  uint8_t* data_stream = ( uint8_t* )data;
  uint32_t crc = 0xedb88320U;
  if ( len <= 0 || data == 0 )
  {
    return 0;
  }
  while ( len )
  {
    uint8_t byte = *data_stream++;
    crc = ( crc >> 8 ) ^ s_crc32[ byte  ^ ( crc & 0xff ) ];
    len--;
  }
  return crc;
}
static uint32_t crc32 ( const void * data , int len ) { uint8_t * data_stream = ( uint8_t * ) data ; uint32_t crc = 0xedb88320U ; if ( len <= 0 || data == 0 ) { return 0 ; } while ( len ) { uint8_t byte = * data_stream ++ ; crc = ( crc >> 8 ) ^ s_crc32 [ byte ^ ( crc & 0xff ) ] ; len -- ; } return crc ; }
Return a 32-bit crc for the given data block
Return a 32 - bit crc for the given data block