MCPcopy
hub / github.com/django/django / mask_hash

Function mask_hash

django/contrib/auth/hashers.py:195–202  ·  view source on GitHub ↗

Return the given hash, with only the first ``show`` number shown. The rest are masked with ``char`` for security reasons.

(hash, show=6, char="*")

Source from the content-addressed store, hash-verified

193
194
195def mask_hash(hash, show=6, char="*"):
196 """
197 Return the given hash, with only the first ``show`` number shown. The
198 rest are masked with ``char`` for security reasons.
199 """
200 masked = hash[:show]
201 masked += char * len(hash[show:])
202 return masked
203
204
205def must_update_salt(salt, expected_entropy):

Callers 5

safe_summaryMethod · 0.85
safe_summaryMethod · 0.85
safe_summaryMethod · 0.85
safe_summaryMethod · 0.85
safe_summaryMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected