X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/514ddaa2ff936ded76554a2ad97f6fe978c6f86e..dae31af21e6ead8318e0dbe4933a9dce4c1a79e5:/client/util.c diff --git a/client/util.c b/client/util.c index a5202458..e81d7600 100644 --- a/client/util.c +++ b/client/util.c @@ -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; +} \ No newline at end of file