MCPcopy
hub / github.com/django/django / encode

Method encode

django/contrib/auth/hashers.py:403–415  ·  view source on GitHub ↗
(self, password, salt)

Source from the content-addressed store, hash-verified

401 parallelism = 8
402
403 def encode(self, password, salt):
404 argon2 = self._load_library()
405 params = self.params()
406 data = argon2.low_level.hash_secret(
407 force_bytes(password),
408 force_bytes(salt),
409 time_cost=params.time_cost,
410 memory_cost=params.memory_cost,
411 parallelism=params.parallelism,
412 hash_len=params.hash_len,
413 type=params.type,
414 )
415 return self.algorithm + data.decode("ascii")
416
417 def decode(self, encoded):
418 argon2 = self._load_library()

Calls 4

paramsMethod · 0.95
force_bytesFunction · 0.90
_load_libraryMethod · 0.80
decodeMethod · 0.45