View source code
Display the source code in std/digest/ripemd.d from which this
page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a
Bugzilla 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 using
local clone.
Module std.digest.ripemd
Computes RIPEMD-160 hashes of arbitrary data. RIPEMD-160 hashes are 20 byte quantities that are like a checksum or CRC, but are more robust.
Category | Functions |
---|---|
Template API | RIPEMD160
|
OOP API | RIPEMD160Digest |
Helpers | ripemd160Of |
This module conforms to the APIs defined in std
. To understand the
differences between the template and the OOP API, see std
.
This module publicly imports std
and can be used as a stand-alone
module.
CTFE
Digests do not work in CTFE
References
Example
//Template API
import std .digest .md;
ubyte[20] hash = ripemd160Of("abc");
writeln(toHexString(hash)); // "8EB208F7E05D987A9B044A8E98C6B087F15A0BFC"
//Feeding data
ubyte[1024] data;
RIPEMD160 md;
md .start();
md .put(data[]);
md .start(); //Start again
md .put(data[]);
hash = md .finish();
Example
//OOP API
import std .digest .md;
auto md = new RIPEMD160Digest();
ubyte[] hash = md .digest("abc");
writeln(toHexString(hash)); // "8EB208F7E05D987A9B044A8E98C6B087F15A0BFC"
//Feeding data
ubyte[1024] data;
md .put(data[]);
md .reset(); //Start again
md .put(data[]);
hash = md .finish();
Functions
Name | Description |
---|---|
ripemd160Of(data)
|
This is a convenience alias for std using the
RIPEMD160 implementation.
|
Structs
Name | Description |
---|---|
RIPEMD160
|
Template API RIPEMD160 implementation.
See std for differences between template and OOP API.
|
Aliases
Name | Type | Description |
---|---|---|
RIPEMD160Digest
|
std
|
OOP API RIPEMD160 implementation.
See std for differences between template and OOP API.
|
Authors
Kai Nacke
The algorithm was designed by Hans Dobbertin, Antoon Bosselaers, and Bart Preneel.
The D implementation is a direct translation of the ANSI C implementation by Antoon Bosselaers.
License
Copyright © 1999-2018 by the D Language Foundation | Page generated by ddox.