Documentation ¶
Overview ¶
Package oshash implements the algorithm that OpenSubtitles.org uses to generate unique hashes.
Calculation is as follows: size + 64 bit checksum of the first and last 64k bytes of the file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrOsHashLen = errors.New("buffer is not a multiple of 8")
Functions ¶
func FromFilePath ¶
Is the equivalent of opening filePath, and calling FromReader with the data and file size.
func FromReader ¶
func FromReader(src io.ReadSeeker, fileSize int64) (string, error)
FromReader calculates the hash reading from src.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.