aboutsummaryrefslogtreecommitdiff
path: root/src/passwordmaker/base_conversion/iterative_conversion.rs
Commit message (Collapse)AuthorAgeFilesLines
* Base Conv: Mul dividend instead of div divisor.Andreas Grois2022-10-251-2/+17
| | | | | | As it turns out, the speed gained by lowering the number of digits in divisor using repeated division is much less than the speed gained by using multiplication of the dividend instead of division of divisor.
* Add precomputed constants for common cases.Andreas Grois2022-10-231-3/+3
| | | | | | There are now 2 features that control the amount of precomputed constants. They can either be 0, 12, or 256. Most users will likely want to go with the 12, so this is the default feature.
* Rename "potency" to "power", the English term.Andreas Grois2022-10-231-16/+16
| | | | | It seems English doesn't use the word potency in this context, but rather uses power.
* Precompute power+exponent for iterative conversionAndreas Grois2022-10-231-10/+22
| | | | | | | | | | | The maximum power of the base that can fit into a given data type is constant. There's no point in computing it at runtime, if we can just store it in a compile-time constants array. The code isn't the most beautiful, but that's mostly because Rust const functions are still a bit limited. One function was duplicated, because it was easy to get a slow version to compile in const context, and const context doesn't really care...
* Fix trait visibility.Andreas Grois2022-10-211-1/+1
|
* Exponential search for largest potency.Andreas Grois2022-10-211-6/+17
| | | | | Speeds up the 20 and 32 byte cases. Has slightly negative impact for 16 byte case.
* Draft of iterative_conversion.Andreas Grois2022-10-181-1/+8
|
* First draft of (untested) iterative conversion.Andreas Grois2022-10-181-0/+144