mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-13 18:57:12 +08:00
chg: micro opt..
This commit is contained in:
parent
453831268a
commit
972fb2e167
1 changed files with 5 additions and 9 deletions
|
@ -1697,16 +1697,12 @@ static inline bool bitflips_match(uint8_t byte, uint32_t state, odd_even_t odd_e
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static uint_fast8_t reverse(uint_fast8_t byte)
|
static uint_fast8_t reverse(uint_fast8_t b)
|
||||||
{
|
{
|
||||||
uint_fast8_t rev_byte = 0;
|
b = (b & 0xF0) >> 4 | (b & 0x0F) << 4;
|
||||||
|
b = (b & 0xCC) >> 2 | (b & 0x33) << 2;
|
||||||
for (uint8_t i = 0; i < 8; i++) {
|
b = (b & 0xAA) >> 1 | (b & 0x55) << 1;
|
||||||
rev_byte <<= 1;
|
return b;
|
||||||
rev_byte |= (byte >> i) & 0x01;
|
|
||||||
}
|
|
||||||
|
|
||||||
return rev_byte;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue