[6184] in java-interest

home help back first fref pref prev next nref lref last post

Re: 8 bit unsigned data type

daemon@ATHENA.MIT.EDU (Mike Paluka)
Mon Mar 25 10:41:28 1996

Date:         Wed, 20 Mar 1996 12:53:25 -0800
Reply-To: Java Interest <JAVA-INTEREST@JAVASOFT.COM>
From: Mike Paluka <mikep@EXMACHINA.COM>
To: Multiple recipients of list JAVA-INTEREST
              <JAVA-INTEREST@JAVASOFT.COM>

At 05:00 AM 3/20/96 +0100, you wrote:
>Hi,
>  I'm writing an encryptation algorithm on java.
>  I must use a 8 bit unsigned integer data type.
>  The byte data type on java is signed.
>  Anyone have any idea?
>

For the purposes of encryption, this probably
won't be a problem, because you won't likely
be using the value in a context where it will
be promoted, nor will you likely be comparing
greater-than/lesser-than (just bit-shifting,
xor'ing, and other bit-wise stuff).

If you have to perform math, such as addition
and subtraction, then use a "short", which
is 16-bits, where you can just mask-off the
higher 8-bits.



--
 *************************
Michael J. Paluka
Senior Software Engineer
Ex Machina, Inc.
mikep@exmachina.com

-----
This message has been forwarded via the JAVA-INTEREST
mailing list.  In order to unsubscribe from this list, send a message to
listserv@javasoft.com with the command 'signoff JAVA-INTEREST' in
the message body (not in the subject line).

home help back first fref pref prev next nref lref last post