File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ it will fallback to loading the built-in ``ujson`` module.
3838.. toctree ::
3939 :maxdepth: 1
4040
41+ uhashlib.rst
4142 uheapq.rst
4243 ujson.rst
4344 usocket.rst
Original file line number Diff line number Diff line change 1+ :mod: `uhashlib ` -- hashing algorithm
2+ ====================================
3+
4+ .. module :: uhashlib
5+ :synopsis: hashing algorithm
6+
7+ This module implements binary data hashing algorithms. Currently, it
8+ implements SHA256 algorithm. Choosing SHA256 was a deliberate choice,
9+ as a modern, cryptographically secure algorithm. This means that a
10+ single algorithm can cover both usecases of "any hash algorithm" and
11+ security-related usage, and thus save space omitting legacy algorithms
12+ like MD5 or SHA1.
13+
14+ Constructors
15+ ------------
16+
17+ .. class :: uhashlib.sha256([data])
18+
19+ Create a hasher object and optionally feed ``data `` into it.
20+
21+
22+ Methods
23+ -------
24+
25+ .. method :: sha256.update(data)
26+
27+ Feed more binary data into hash.
28+
29+ .. method :: sha256.digest()
30+
31+ Return hash for all data passed thru hash, as a bytes object. After this
32+ method is called, more data cannot be fed into hash any longer.
33+
34+ .. method :: sha256.hexdigest()
35+
36+ This method is NOT implemented. Use ``ubinascii.hexlify(sha256.digest()) ``
37+ to achieve similar effect.
You can’t perform that action at this time.
0 commit comments