From: OCID
Subject: Quick silly question.
Date: 
Message-ID: <bgc3k8$t0k$1@mozo.cc.purdue.edu>
What would be the quickest way to convert a character/integer to 8-bit
binary so
that I can use a bit-xor on it? I have 2 which is 00000010 in binary and I
want to
XOR it to a character like say H which would be 01001000.

From past experience writing my own routines, I've discovered that Lisp
usually
has such things built in and are more efficient in most cases.

Any ideas on where to look in the Hyperspec?

Thx

From: Barry Margolin
Subject: Re: Quick silly question.
Date: 
Message-ID: <sQgWa.14$hu1.4@news.level3.com>
In article <············@mozo.cc.purdue.edu>, OCID <······@purdue.edu> wrote:
>What would be the quickest way to convert a character/integer to 8-bit
>binary so
>that I can use a bit-xor on it? I have 2 which is 00000010 in binary and I
>want to
>XOR it to a character like say H which would be 01001000.
>
>From past experience writing my own routines, I've discovered that Lisp
>usually
>has such things built in and are more efficient in most cases.
>
>Any ideas on where to look in the Hyperspec?

CHAR-CODE will convert the character to an integer.  You don't need to do
anything to the integer -- the LOGXOR function will operate on the binary
representation.

-- 
Barry Margolin, ··············@level3.com
Level(3), Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
From: Jeff Greif
Subject: Re: Quick silly question.
Date: 
Message-ID: <HfnWa.37818$o%2.21376@sccrnsc02>
(logxor 2 (char-int #\H))

"OCID" <······@purdue.edu> wrote in message
·················@mozo.cc.purdue.edu...
> What would be the quickest way to convert a character/integer to 8-bit
> binary so
> that I can use a bit-xor on it? I have 2 which is 00000010 in binary and I
> want to
> XOR it to a character like say H which would be 01001000.