OT - calculating length

Atom 'Smasher' atom at suspicious.org
Sun May 9 21:38:29 CEST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

it's been a long time since i had any math classes... can anyone help me
figure out how to calculate octet lengths as specified in
	rfc2440:4.2.2.2. Two-Octet Lengths

	A two-octet Body Length header encodes a length of from 192 to
	8383 octets.  It is recognized because its first octet is in the
	range 192 to 223.  The body length is equal to:

	bodyLen = ((1st_octet - 192) << 8) + (2nd_octet) + 192

so, if i have something that's a certain size, how do i calculate that as
a two octet representation? how do i verify that it's correct? can someone
explain that to me in a "dumbed down" way?

thanks...


 	...atom

 _________________________________________
 PGP key - http://atom.smasher.org/pgp.txt
 3EBE 2810 30AE 601D 54B2 4A90 9C28 0BBF 3D7D 41E3
 -------------------------------------------------

	"Aerial bombardment is never proportionate, measured or
	 targeted. It evolves a logic of its own, an escalation
	 of horror similar to that unleashed by the terrorist.
	 Like all distant and indiscriminate violence, it breeds
	 a violent response. It is the dumbest weapon of war."
		-- Simon Jenkins
		They Opted to Bomb - It Had Better Work
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)
Comment: What is this gibberish?  -  http://atom.smasher.org/links/#digital_signatures

iEYEARECAAYFAkCeiL0ACgkQnCgLvz19QePBmACeIaZl0f4ao4zXKq/oQUuOu/li
ZsQAniKUx+XwQn1nZDo0jSbWI/5iYG4J
=7slN
-----END PGP SIGNATURE-----



More information about the Gnupg-users mailing list