Skip to content

Commit

Permalink
use methods to build formatted cipher
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed Mar 21, 2024
1 parent 2eae71d commit 266b04a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion django_crypto_fields/cipher/cipher.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ def __init__(

@property
def cipher(self) -> bytes:
return self.hash_prefix + self.hashed_value + self.cipher_prefix + self.secret
return self.hash_with_prefix + self.secret_with_prefix

@property
def hash_with_prefix(self) -> bytes:
return self.hash_prefix + self.hashed_value

@property
def secret_with_prefix(self) -> bytes:
return self.cipher_prefix + self.secret

0 comments on commit 266b04a

Please sign in to comment.