Swift 3 code for generating file hash compatible with opensubtitles.org's API
Swift

README.md

OpenSubtitlesHash.swift

Swift 3 code for generating file hash compatible with opensubtitles.org's API. More information about the OpenSubtitles API at http://trac.opensubtitles.org/projects/opensubtitles.

Usage example

let videoUrl = Bundle.main.url(forResource: "dummy5", withExtension: "rar")
let videoHash = OpenSubtitlesHash.hashFor(videoUrl!)
debugPrint("File hash: \(videoHash.fileHash)\nFile size: \(videoHash.fileSize)")

Installation

Manual installation by including OpenSubtitlesHash.swift in project.