Module eco.hash.sha1
SHA1 hash functions.
Provides one-shot hashing via sum and incremental hashing via new. The digest is returned as raw binary bytes (20 bytes).
Functions
| sum (data) | Compute SHA1 digest of the given data. |
| new () | Create a new incremental SHA1 context. |
Class sha1
| sha1:update (data) | Update digest with more data. |
| sha1:final () | Finalize and return digest. |
Functions
- sum (data)
-
Compute SHA1 digest of the given data.
Parameters:
- data string Input bytes.
Returns:
-
string
Raw 20-byte digest.
- new ()
-
Create a new incremental SHA1 context.
Returns:
-
sha1
ctx
Class sha1
sha1 object created by new.