size+ed2k UDP API question

Want to help out? Need help accessing the AniDB API? This is the place to ask questions.

Moderator: AniDB

Locked
MistaMuShu
Posts: 10
Joined: Sat May 28, 2005 2:50 am

size+ed2k UDP API question

Post by MistaMuShu »

Hey,

I'm finishing up the last couple UDP API commands. For the commands FILE, MYLIST, MYLISTADD, and MYLISTDEL, I can't find an explanation in the documentation about the following:

{int4 lid} - mylist id. I have no clue what this is. fid was mentioned in the wiki, but not lid. It seems to be another form of unique id for files?

{int4 size}, {str ed2k} - size+ed2k. What are the units for size? And, just curious, why is size needed if ed2k hashes are unique?

I tried searching through the forums and reading the doc, but the forum gave me a bunch of DB change requests. Any help would be greatly appreciated.
dinoex
Posts: 35
Joined: Wed Nov 17, 2004 8:28 pm
Contact:

Re: size+ed2k UDP API question

Post by dinoex »

(Not an official answer)
MistaMuShu wrote:{int4 lid} - mylist id.
This is your Id for your mylist entry.
which holds "ON DISK", and other stuff.
MistaMuShu wrote:{int4 size}, {str ed2k} - size+ed2k. What are the units for size?
size is in bytes, exact number.
hhaamu
Posts: 84
Joined: Mon Feb 07, 2005 7:59 am

Re: size+ed2k UDP API question

Post by hhaamu »

(Not an official answer, either. plus just a guess)
MistaMuShu wrote:{int4 size}, {str ed2k} - size+ed2k. What are the units for size? And, just curious, why is size needed if ed2k hashes are unique?
I'm guessing that's an error in the documentation. It's asking for {str md4} and not the whole ed2k hash. An ed2k hash basically is of this format: ed2k://|file|filename|size|md4|
PetriW
AniDB Staff
Posts: 1522
Joined: Sat May 24, 2003 2:34 pm

Re: size+ed2k UDP API question

Post by PetriW »

hhaamu wrote:(Not an official answer, either. plus just a guess)
MistaMuShu wrote:{int4 size}, {str ed2k} - size+ed2k. What are the units for size? And, just curious, why is size needed if ed2k hashes are unique?
I'm guessing that's an error in the documentation. It's asking for {str md4} and not the whole ed2k hash. An ed2k hash basically is of this format: ed2k://|file|filename|size|md4|
No, that's really totally wrong.

No ed2k hash is guaranteed to be unique. To make the chance of a clash lower the size of a file is also included in an ed2k link (notice, a link is not a hash). Thus the api uses both the size and the ed2k hash to identify a file.

The ed2k hash itself uses md4 but it's not a true md4 hash if the file is larger than 9.5 mb, instead it's the hash of the hashes of all 9.5mb chunks.
I encourage you to do some reading if you want to create ed2k hashes yourself.

ed2k://|file|filename|size|md4| is an ed2k LINK

an ed2k link has these fields
ed2k://|file|filename|size|ed2khash|
(actually it has more but I don't want to go too deep)
exp
Site Admin
Posts: 2438
Joined: Tue Oct 01, 2002 9:42 pm
Location: Nowhere

Post by exp »

lid is a mylist id. it does only indirectly point to a file. basically it's the file<->user relation.

size is in bytes.

ed2k is an ed2k _hash_, not a complete ed2k link. So it does not contain size information. However size+ed2k together are used to identify files, so size is always a required field.

BYe!
EXP
Locked