refactor set_key -> position_key

This commit is contained in:
2025-03-20 04:01:15 -05:00
parent 7b92a6b40b
commit 65f3559ef0
8 changed files with 241 additions and 247 deletions

View File

@@ -16,7 +16,7 @@ class Customer:
@classmethod
def create(cls, nkode_policy: NKodePolicy, cipher: CustomerCipher) -> 'Customer':
if nkode_policy.distinct_sets > cipher.keypad_size.numb_of_keys:
if nkode_policy.distinct_positions > cipher.keypad_size.numb_of_keys:
raise ValueError("Distinct sets cannot be greater than the number of keys")
if nkode_policy.distinct_properties > cipher.keypad_size.total_props:
raise ValueError("Distinct properties cannot be greater than the total number of properties")
@@ -76,7 +76,7 @@ class Customer:
distinct_properties = len(set(passcode_prop_idx))
if (
self.nkode_policy.min_nkode_len <= nkode_len <= self.nkode_policy.max_nkode_len and
distinct_sets >= self.nkode_policy.distinct_sets and
distinct_sets >= self.nkode_policy.distinct_positions and
distinct_properties >= self.nkode_policy.distinct_properties
):
return True