Ejemplo n.º 1
0
bool File::Read16BE(long long offset, uint16_t* dst)
{
	if (!Read(offset, dst, 2)) {
		return false;
	}
	*dst = _rotl16(*dst, 8);
	return true;
}
Ejemplo n.º 2
0
uint16_t hashFileName(const char* fileName)
{
	uint16_t hash = 0;
	while (0 != *fileName)
	{
		uint8_t c = ((*fileName & 0x7F) < 0x60) ? *fileName : *fileName - 0x20;
		hash = _rotl16(hash, 9);	// xchg bl, bh | rol bx, 1
		hash += c;
		fileName++;
	}
	return hash;
}