MCPcopy
hub / github.com/django/django / _unicode_ci_compare

Function _unicode_ci_compare

django/contrib/auth/forms.py:23–32  ·  view source on GitHub ↗

Perform case-insensitive comparison of two identifiers, using the recommended algorithm from Unicode Technical Report 36, section 2.11.2(B)(2).

(s1, s2)

Source from the content-addressed store, hash-verified

21
22
23def _unicode_ci_compare(s1, s2):
24 """
25 Perform case-insensitive comparison of two identifiers, using the
26 recommended algorithm from Unicode Technical Report 36, section
27 2.11.2(B)(2).
28 """
29 return (
30 unicodedata.normalize("NFKC", s1).casefold()
31 == unicodedata.normalize("NFKC", s2).casefold()
32 )
33
34
35class ReadOnlyPasswordHashWidget(forms.Widget):

Callers 1

get_usersMethod · 0.85

Calls 1

normalizeMethod · 0.45

Tested by

no test coverage detected