Forum rules
Under no circumstances is spamming or advertising of any kind allowed. Do not post any abusive, obscene, vulgar, slanderous, hateful, threatening, sexually-orientated or any other material that may violate others security. Profanity or any kind of insolent behavior to other members (regardless of rank) will not be tolerated. Remember, what you don’t find offensive can be offensive to other members. Please treat each other with the kind of reverence you’d expect from other members.
Failure to comply with any of the above will result in users being banned without notice. If any further details are needed, contact: “The team” using the link at the bottom of the forum page. Thank you.
User avatar
rednoah
Posts: 84
Joined: Tue Mar 11, 2008 10:02 pm

Java hash source updated

Wed Apr 02, 2008 9:50 pm

Hey,

I went a little bit overboard when allowing for arbitrary hash length, so I made a few adjustments.

The hash is now calculated via longs and not (immutable) BigIntegers making the whole thing roughly 200x faster.

Also I'd like to note, that a third small test file would be nice, 'cause I don't really know what to do if the size is smaller than 64k and not a multiple of 8.

User avatar
oss
Site Admin
Posts: 5890
Joined: Sat Feb 25, 2006 11:26 pm
Contact: Website

Thu Apr 17, 2008 2:15 pm

Thanks for update! Also I never saw movie, where are needed subtitles smaller than 64kb, do you ? :)

User avatar
eduo
Posts: 716
Joined: Sat Feb 10, 2007 1:40 am
Location: Information Technology
Contact: ICQ Website Yahoo Messenger

Thu Apr 17, 2008 3:41 pm

Rednoah: The hash doesn't work in videos that small. If you try to hash a file that small (which amounts to what, five seconds of ultracompressed video?) you should abort the operation.

OpenSubtitles has no hash for files that small anyway.

User avatar
rednoah
Posts: 84
Joined: Tue Mar 11, 2008 10:02 pm

Sat Apr 26, 2008 11:50 am

I was just wondering how to handle small files cause my algorithm and the C# one come up with a different results.

But I guess subs for 5s movies don't really make sense so this will never be a problem so I'll leave it at that.

User avatar
eduo
Posts: 716
Joined: Sat Feb 10, 2007 1:40 am
Location: Information Technology
Contact: ICQ Website Yahoo Messenger

Sat Apr 26, 2008 12:37 pm

Rednoah: In reality you should never try getting the video hash of anything smaller than 129K.

What I've done is to set-up a double function, so I use the same "Makehash" for video and subtitles (which have a simpler MD5 hash). That way I can recycle a lot of routines and calls.

User avatar
rednoah
Posts: 84
Joined: Tue Mar 11, 2008 10:02 pm

Sun Dec 21, 2008 3:19 pm

Hi,

I just added a stream based implementation of the hash function to the wiki. It might be useful if you only have an InputStream to work with.

lg
red

User avatar
oss
Site Admin
Posts: 5890
Joined: Sat Feb 25, 2006 11:26 pm
Contact: Website

Mon Dec 22, 2008 8:10 am

thanks rednoah.

Return to “Developing”

Who is online

Users browsing this forum: No registered users and 27 guests