aboutsummaryrefslogtreecommitdiff
path: root/src/passwordmaker/base_conversion/mod.rs
diff options
context:
space:
mode:
authorAndreas Grois <andi@grois.info>2022-10-27 08:56:51 +0200
committerAndreas Grois <andi@grois.info>2022-10-27 08:56:51 +0200
commit6ee6a65b30bdbd4956b18518009f25a0b7db0979 (patch)
treef4cf7e2a7c4903b620cb1e8e8c6cae5eb173b15c /src/passwordmaker/base_conversion/mod.rs
parent37d19e9e9171c819d92afe395e30359aa059ee15 (diff)
Base Conv: Combine shifting and padding.
Having one function that does both seems to be measurably faster, though I would have expected the compiler to inline and generate comparable assembly. Well, seems it didn't.
Diffstat (limited to 'src/passwordmaker/base_conversion/mod.rs')
-rw-r--r--src/passwordmaker/base_conversion/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/passwordmaker/base_conversion/mod.rs b/src/passwordmaker/base_conversion/mod.rs
index cab838e..6640880 100644
--- a/src/passwordmaker/base_conversion/mod.rs
+++ b/src/passwordmaker/base_conversion/mod.rs
@@ -1,5 +1,5 @@
use std::convert::TryInto;
-use iterative_conversion_impl::PadWithAZero;
+use iterative_conversion_impl::PaddedShiftLeft;
pub(super) use iterative_conversion::IterativeBaseConversion;
pub(super) use iterative_conversion_impl::{SixteenBytes, ArbitraryBytes};
@@ -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>> + PrecomputedMaxPowers<usize>,
+ for<'a> T::Output: From<&'a usize> + From<&'a u32> + PaddedShiftLeft<Output = ArbitraryBytes<M>> + PrecomputedMaxPowers<usize>,
{
type Output = IterativeBaseConversion<ArbitraryBytes<N>, usize>;
fn convert_to_base(self, base : usize) -> Self::Output {