Page 1 of 1

size+ed2k UDP API question

Posted: Thu Aug 04, 2005 3:43 am
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.

Re: size+ed2k UDP API question

Posted: Thu Aug 04, 2005 4:10 am
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.

Re: size+ed2k UDP API question

Posted: Thu Aug 04, 2005 9:25 am
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|

Re: size+ed2k UDP API question

Posted: Thu Aug 04, 2005 12:03 pm
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)

Posted: Tue Aug 09, 2005 4:19 pm
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