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

[Feature] Piecewise and timing options #281

Closed
simsong opened this issue Dec 7, 2012 · 4 comments
Closed

[Feature] Piecewise and timing options #281

simsong opened this issue Dec 7, 2012 · 4 comments

Comments

@simsong
Copy link
Collaborator

simsong commented Dec 7, 2012

Converted from SourceForge issue 3571311, submitted by chudel

Good day,

I am interested in using hashdeep in some research capacities and could benefit from the following enhancement request(s):

  • Piecewise, I would like to specify the number of Pieceiwse pieces (or range) to compute. For example "-p 1024b -P 2" would print only the second piecewise piece of size 1024bytes. -P 1-4 might print just the first 4 pieces, -P 1 just the first piece and -P 0 prints all the pieces (redundant way to achieve existing functionality)
  • time - I would like to also see the time it takes to calculate each hash as part of the output.

Thanks,

@simsong
Copy link
Collaborator Author

simsong commented Dec 7, 2012

Submitted by jessekornblum

These functions would be awkward to implement in hashdeep, and in general, can already be accomplished using other commands. For example, to get the first 1-4 lines of the output, use the 'head' command:

$ hashdeep [FILES] | head -n 4

For the timing, use the time command:

$ time hashdeep [FILES]

@simsong
Copy link
Collaborator Author

simsong commented Dec 7, 2012

Submitted by chudel

I respect your answer. I will check-out the code and make the changes. While the capabilities are available in separte pieces (using as you mention the 'head' function and the 'time' function in unix), if I only wanted the first piece of every file in the system, it would be a challenge to calculate the time it takes just to compute the first piecewise hash. Also, it would be very inefficient because I would wind up hashing all the pieces when I only wanted the first.

Let me know if you would like to consider taking the changes once made.

Thanks & Cheers - this is some great software!

@simsong
Copy link
Collaborator Author

simsong commented Dec 7, 2012

Submitted by jessekornblum

If you only want to hash the first part of each file, you can do that, for example, using the dd command:

$ dd if=FILENAME bs=BYTES count=1 | hashdeep

@simsong simsong closed this as completed Dec 7, 2012
@chudel
Copy link

chudel commented Aug 13, 2013

FYI - I made a fork to do this, calculating only the initial hash value of size xxx bytes of each file. Option for this is -P (capital P).

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

No branches or pull requests

2 participants