MessageDigest
classin packageklyn.cryptography
public abstract class MessageDigest extends Object:
Abstract base class for text-oriented message digests.
Concrete algorithms are exposed as dedicated subclasses such as `SHA256`,
`SHA512`, `SHA3_256` or `MD5`. This keeps the public API explicit and easy
to discover while preserving the shared buffering and file-digest helpers in
one place.
import klyn.cryptography
md as MessageDigest = SHA256()
digest = md.digest("hello")
print(digest.size)
print(SHA512().digestInfo("hello").hex)
Properties
| Modifier and Type |
Member |
Description |
| public readonly property |
algorithm |
Canonical digest algorithm name. |
Methods
| Modifier and Type |
Member |
Description |
| public |
digest |
Hashes the buffered text and an optional final chunk. |
| public |
digestFile |
Hashes a file from a `String` or `Path` value. |
| public |
digestFileInfo |
Hashes a file and returns a structured digest view. |
| public |
digestInfo |
Hashes the buffered text and returns a structured digest view. |
| public static |
getInstance |
Compatibility factory for dynamic algorithm selection. |
| public |
reset reset() as Void:
|
Resets the buffered text accumulated with `update`. |
| public override |
toString |
No summary. |
| public |
update |
Appends text to the in-memory digest buffer. |