RHash icon indicating copy to clipboard operation
RHash copied to clipboard

Add Oshash

Open scruffynerf opened this issue 3 years ago • 2 comments

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

scruffynerf avatar Jun 29 '22 17:06 scruffynerf

@rhash similar algorithm for reference.

  • https://github.com/kalafut/imohash
  • https://github.com/kalafut/py-imohash/

def-fun avatar Dec 24 '22 14:12 def-fun

Another vote for both oshash and imohash.

bendauphinee avatar Dec 28 '22 01:12 bendauphinee