Project

General

Profile

Actions

Task #1934

closed

Provide stateful digest

Added by Yingdi Yu about 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Security
Target version:
Start date:
Due date:
% Done:

90%

Estimated time:

Description

Digest may be calculated in two ways: 1) calculate a digest on a determined input; 2) update the digest with dynamic input.

For now, ndn-cxx only supports the first style. Given digest may be widely used in NDN applications, it might be useful to support both styles (e.g., the second style is needed by ChronoSync based applications).

The second style can be abstracted as a StatefulDigest which can be continuously updated until a finalize call is made. A pseudo code should look like:

StatefulDigest digest;
digest.update(input1, size1);
digest.update(input2, size2);
digest.update(input3, size3);
...
ConstBufferPtr result = digest.getDigest();
Actions

Also available in: Atom PDF