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

Add Oshash #209

Open
scruffynerf opened this issue Jun 29, 2022 · 2 comments
Open

Add Oshash #209

scruffynerf opened this issue Jun 29, 2022 · 2 comments
Labels
FR hash algorithm FR for a hash function

Comments

@scruffynerf
Copy link

scruffynerf commented Jun 29, 2022

https://github.com/r-salas/oshash

This is being used more and more, it's very fast, and resistant. It's a hash of filesize, and the beginning and end of the file.

In pseudo-code, the hash is computed in the following way:

file_buffer = open("/path/to/file/")
head_checksum = checksum(file_buffer.head(64 * 1024))  # 64KB
tail_checksum = checksum(file_buffer.tail(64 * 1024))  # 64KB
file_hash = file_buffer.size + head_checksum + tail_checksum

More code (including C code) at https://trac.opensubtitles.org/projects/opensubtitles/wiki/HashSourceCodes

@rhash rhash added hash algorithm FR for a hash function FR labels Jun 30, 2022
@def-fun
Copy link

def-fun commented Dec 24, 2022

@rhash similar algorithm for reference.

@bendauphinee
Copy link

Another vote for both oshash and imohash.

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

No branches or pull requests

4 participants