mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 13:23:51 -07:00
ADD: Binary Encoded Digit -> Decimal
ADD: Decimal -> Binary Encoded Digit Ie decimal 2345 becomes 0x2345 and hex 0x2345 becomes decimal 2345
This commit is contained in:
parent
514ddaa2ff
commit
dae31af21e
2 changed files with 23 additions and 4 deletions
|
@ -566,3 +566,12 @@ uint32_t reflect(uint32_t v, int b) {
|
|||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
uint64_t HornerScheme(uint64_t num, uint64_t divider, uint64_t factor) {
|
||||
uint64_t remainder=0, quotient=0, result=0;
|
||||
remainder = num % divider;
|
||||
quotient = num / divider;
|
||||
if(!(quotient == 0 && remainder == 0))
|
||||
result += HornerScheme(quotient, divider, factor) * factor + remainder;
|
||||
return result;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue