org.jmythapi.utils
Class OpenSubtitlesHasher

java.lang.Object
  extended by org.jmythapi.utils.OpenSubtitlesHasher

public class OpenSubtitlesHasher
extends Object

Hash code is based on Media Player Classic. In natural language it calculates: size + 64bit checksum of the first and last 64k (even if they overlap because the file is smaller than 128k).

This method was copied from opensubtitles.org.


Constructor Summary
OpenSubtitlesHasher()
           
 
Method Summary
static String computeHash(File file)
           
static String computeHash(InputStream stream, long length)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenSubtitlesHasher

public OpenSubtitlesHasher()
Method Detail

computeHash

public static String computeHash(File file)
                          throws IOException
Throws:
IOException

computeHash

public static String computeHash(InputStream stream,
                                 long length)
                          throws IOException
Throws:
IOException


Copyright © 2008-2013. All Rights Reserved.