aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorAndreas Grois <soulsource@users.noreply.github.com>2022-11-04 21:59:01 +0100
committerGitHub <noreply@github.com>2022-11-04 21:59:01 +0100
commit3254d705f91b9440457c1b9322c3a3edfd4b217e (patch)
tree73d80a5875523dee4a0bd98ebcb3b6f9bb0603bf /src/lib.rs
parentdaa045ab422062692705ff63c1a5618c9bef9801 (diff)
parentc385c90148178ad38b17491d45f5dcc2cbe06c9c (diff)
Merge pull request #1 from soulsource/feature/heap-allocation-free-base-conversion
Feature/heap allocation free base conversion While skipping the heap allocation is nice, the real gain is the option to early-out of password generation once the desired length has been reached.
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index a005e43..955daf8 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -17,6 +17,23 @@
//!
//! [`PasswordMaker`] is the main part of this crate. You give it settings similar to those of a PasswordMaker Pro profile,
//! and it gives you a password that's hopfully the same you'd get from PasswordMaker Pro for the same input.
+//!
+//! # Features
+//! The library comes with a set of precomputed powers to (slightly) speed up computation in common use cases. By default, constants
+//! for the lengths of the pre-defined character sets of PasswordMaker Pro are included (10, 16, 32, 52, 62, 94), amounting to a total
+//! of 360 bytes on a 32bit machine, and 408 bytes on a 64bit machine (and some instructions to read them). For all other character
+//! set lengths the values are computed at runtime when needed. Those values are in the (default-enabled)
+//! `precomputed_common_max_powers` feature.
+//!
+//! If you prefer simpler code and want to save a couple of bytes in the binary, you can disable `default-features` to use runtime
+//! computation for all values, at the cost of a slight performance impact.
+//!
+//! On the other hand, if binary size is not of concern, you might want to enable the `precomputed_max_powers` feature.
+//! This feature enables precomputed powers for all bases in the range 2..130. It therefore needs 7680 bytes on a 32bit machine, and
+//! 8704 bytes on a 64bit machine (plus some extra instructions).
+//!
+//! # Warning
+//! This library has NOT been tested on 16bit machines. It might work, but probably does not.
mod passwordmaker;