Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
d96a9164
Commit
d96a9164
authored
Dec 02, 2014
by
Paul Sokolovsky
Browse files
docs: Add quick docs for uhashlib.
parent
7f0699ee
Changes
2
Hide whitespace changes
Inline
Side-by-side
docs/library/index.rst
View file @
d96a9164
...
...
@@ -38,6 +38,7 @@ it will fallback to loading the built-in ``ujson`` module.
.. toctree::
:maxdepth: 1
uhashlib.rst
uheapq.rst
ujson.rst
usocket.rst
...
...
docs/library/uhashlib.rst
0 → 100644
View file @
d96a9164
:mod:`uhashlib` -- hashing algorithm
====================================
.. module:: uhashlib
:synopsis: hashing algorithm
This module implements binary data hashing algorithms. Currently, it
implements SHA256 algorithm. Choosing SHA256 was a deliberate choice,
as a modern, cryptographically secure algorithm. This means that a
single algorithm can cover both usecases of "any hash algorithm" and
security-related usage, and thus save space omitting legacy algorithms
like MD5 or SHA1.
Constructors
------------
.. class:: uhashlib.sha256([data])
Create a hasher object and optionally feed ``data`` into it.
Methods
-------
.. method:: sha256.update(data)
Feed more binary data into hash.
.. method:: sha256.digest()
Return hash for all data passed thru hash, as a bytes object. After this
method is called, more data cannot be fed into hash any longer.
.. method:: sha256.hexdigest()
This method is NOT implemented. Use ``ubinascii.hexlify(sha256.digest())``
to achieve similar effect.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment