oshash

package
v0.25.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2024 License: AGPL-3.0 Imports: 5 Imported by: 1

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

func FromFilePath(filePath string) (string, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL