crypto.sha256 (or 512 for that matter) hash files #21642
Answered
by
JalonSolov
danabooth
asked this question in
Questions and Answers
-
Is there a quick and easy way to hash a file without having to manually open the stream? I know that some other languages have this, but I didn't really find anything in the V docs about this. |
Beta Was this translation helpful? Give feedback.
Answered by
JalonSolov
Jun 4, 2024
Replies: 1 comment 3 replies
-
Those other languages are just adding "sugar" - the stream still has to be opened, their lib routines just do it for you. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
V doesn't have it now, but PRs are always welcome. :-)
One example of doing what you want (plus a whole lot more) can be found in the coreutils code.
https://github.com/vlang/coreutils/blob/main/common/sums/sums.v
That's the common code for the
sha*sum
tools.