startDigest method
Starts an incremental digest, for input that arrives in pieces.
Use it when the data is not already in memory — a large file, a socket, a
request body — or when the total byte count matters as much as the digest
itself (EvpDigest.length). For a buffer in hand, digest is simpler.
The returned object owns native memory: EvpDigest.dispose it in a
finally.
final digest = openSsl.startDigest('sha256');
try {
await digest.addStream(file.openRead());
print('${digest.length} bytes -> ${digest.finish()}');
} finally {
digest.dispose();
}
Implementation
EvpDigest startDigest(
String algorithmName, {
int bufferSize = EvpDigest.defaultBufferSize,
}) =>
EvpDigest(this, algorithmName, bufferSize: bufferSize);