Skip to content

streaming input? #2

Open
Open
@jrochkind

Description

Other hashes like SHA512 or MD5 support creating a hash from an IO stream.

This allows you to take input at a remote network location, and create a hash for it reading it a chunk at a time, without having to write it to disk first, or ever have to keep it in it's entirety in memory, and creating the digest as you go.

For instance, with stdlib:

secret = Digest::SHA256.new
source.each { |chunk| secret.update(chunk) }
secret.digest

(I think I understand that this will not actually hold the whole source in memory, although correct me if I'm wrong!)

Is this possible with the blake2b algorithm? Could it be made possible with this gem?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions