How to resume hashing #2
stefansundin
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If you interrupt the program with Ctrl-C, it will print the internal state of the hash function and print a command that will resume the process from that position in the object. This can be useful if it is prohibitively expensive (or time consuming) to restart a failed hashing from the beginning.
Here's an example:
As the output instructs, you can resume the hashing by re-running the command with the
-resume
switch. The program will use a range request to avoid downloading previous data.If you're curious about what's inside of the base64 data, have a look at the Go source code here: https://github.com/golang/go/blob/go1.17/src/crypto/sha256/sha256.go#L50-L57
As the warning suggests, please do not assume that the value will work across versions of s3sha256sum or versions of Go.
There's also paranoid mode for the extra paranoid. If you enable it, then s3sha256sum will continually output the state and resume command on an interval.
For example, to have it output the state every second, use
-paranoid 1s
:This should help you if you're afraid that something else will kill s3sha256sum and interrupt the process. As long as you have the console output somewhere, you can recover.
Lastly, if someone can think of a good way to compress the state to make the command a bit shorter, please let me know.
Beta Was this translation helpful? Give feedback.
All reactions