refactor set_key -> position_key
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user