]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/util.c
ADD: Binary Encoded Digit -> Decimal
[proxmark3-svn] / client / util.c
index a520245867a935abc1dc75f9acf2e35955bf8011..e81d760014ce107d6a2f09fa95aafe1a2179c20e 100644 (file)
@@ -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
Impressum, Datenschutz