View source code
Display the source code in dmd/common/sha.d from which thispage was generated on github.
Report a bug
If you spot a problem with this page, click here to create aGitHub issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.Requires a signed-in GitHub account. This works well for small changes.If you'd like to make larger changes you may want to consider usinglocal clone.
Struct dmd.common.sha.SHA
Template API SHA1/SHA2 implementation. Supports: SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224 and SHA-512/256.
struct SHA(uint hashBlockSize, uint digestSize);
The hashBlockSize and digestSize are in bits. However, it's likely easier to simply use the convenience aliases: SHA1, SHA224, SHA256, SHA384, SHA512, SHA512_224 and SHA512_256.
See std for differences between template and OOP API.
Methods
| Name | Description |
|---|---|
finish
()
|
Returns the finished SHA hash. This also calls start to
reset the internal state.
|
put
()
|
Use this to feed the digest with data.
Also implements the isOutputRange
interface for ubyte and const(ubyte)[].
|
start
()
|
SHA initialization. Begins an SHA1/SHA2 operation. |
Authors
License
Copyright © 1999-2026 by the D Language Foundation | Page generated by ddox.