diff options
author | Andreas Grois <andi@grois.info> | 2022-10-23 20:26:23 +0200 |
---|---|---|
committer | Andreas Grois <andi@grois.info> | 2022-10-23 20:26:23 +0200 |
commit | 1f57846664b97f0cb630bf5fee13dfbc66f7c77a (patch) | |
tree | ea301ae8471bc8479b1b661508c977039a7c997e /src/passwordmaker/base_conversion/mod.rs | |
parent | aa9dc24e9ec72228c28419a9072a4183a461b1f1 (diff) |
Add precomputed constants for common cases.
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.
Diffstat (limited to 'src/passwordmaker/base_conversion/mod.rs')
-rw-r--r-- | src/passwordmaker/base_conversion/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/passwordmaker/base_conversion/mod.rs b/src/passwordmaker/base_conversion/mod.rs index 311f7c5..cab838e 100644 --- a/src/passwordmaker/base_conversion/mod.rs +++ b/src/passwordmaker/base_conversion/mod.rs @@ -3,7 +3,7 @@ use iterative_conversion_impl::PadWithAZero; pub(super) use iterative_conversion::IterativeBaseConversion; pub(super) use iterative_conversion_impl::{SixteenBytes, ArbitraryBytes}; -use self::iterative_conversion::ConstantMaxPowerCache; +use self::iterative_conversion::PrecomputedMaxPowers; mod iterative_conversion; mod iterative_conversion_impl; @@ -16,7 +16,7 @@ pub(super) trait BaseConversion { impl<T, const N : usize, const M : usize> BaseConversion for T where T : ToArbitraryBytes<Output = ArbitraryBytes<N>>, - for<'a> T::Output: From<&'a usize> + From<&'a u32> + PadWithAZero<Output = ArbitraryBytes<M>> + ConstantMaxPowerCache<usize>, + for<'a> T::Output: From<&'a usize> + From<&'a u32> + PadWithAZero<Output = ArbitraryBytes<M>> + PrecomputedMaxPowers<usize>, { type Output = IterativeBaseConversion<ArbitraryBytes<N>, usize>; fn convert_to_base(self, base : usize) -> Self::Output { |