Theodore Hong schrieb:
> 
> Just to stir up more trouble, I'd like to belatedly object to the proposal
> to represent all numeric header fields in hex (i.e. htl, length, etc.).  I
> think it just makes things more complicated because it makes it more
> difficult to read messages and easily see what's going on (which was the
> point of a text protocol) if you have to translate hex.
right, decimal is easier to read for us (because we learned to use dec
since
we're born and hex since we use computers), but small numbers (between 0
and
32 / 0x0 and 0x20) are readable and larger nubers shouldn't occur as htl
or
depth. with uniqueID you needn't do anything else looking if its equal
to another.
length is a problem, but reading as shown below makes hex-numbers quite
readable:
0xtttggmmmkkbbb
b are the bytes
k are the kbytes/4
m are the Mbytes
g are the Gbytes/4
t are the Tbytes
....
>                                                          Also clients have
> to parse hex, which they don't have to now (for UniqueId you can just drop
i hope i understand you correctly. IMO parsing hex is easyer then
parsing dec.
some words about uniqueID: hex, dec, oct, alphanum.... you must only
look if it
has a specific value. no operations lke add, lt, gt sub ... are made
with it.
it does not matter what it is. but now it is hex. and we've no reason to
change
it.
> leading 0s and compare case-insensitive).
> 
> I don't think consistency is really an issue -- HTTP, for example, mixes
> hex chunk lengths with decimal everywhere else.  Or make the UniqueId
> decimal instead of turning everything else to hex -- the only reason to
> have it hex, as far as I can tell, is that it looks prettier.
it's easier to read with software. write functions dec2bin, bin2dec,
hex2bin
and bin2hex. the hex-stuff is easier (and faster, i think - you can use
bit-masking and shifting instead of useing div - and useing div with x86
is
a pretty ugly task).
> 
> theo
1723


_______________________________________________
Freenet-dev mailing list
Freenet-dev at lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/freenet-dev

Reply via email to