Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

streaming input? #2

Open
jrochkind opened this issue Aug 15, 2019 · 0 comments
Open

streaming input? #2

jrochkind opened this issue Aug 15, 2019 · 0 comments

Comments

@jrochkind
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant