[Q][Smalltalk][hex] converting binary to hex
Richard A. O'Keefe
ok at cs.otago.ac.nz
Tue Mar 19 23:16:06 UTC 2002
> hex := '0123456789ABCDEF'.
> aByteArray do: [:each | vvv
> aStream nextPut: (hex at: each // 256 + 1).
aStream nextPut: (hex at: each \\ 256 + 1)].
^^^
Change both occurrences of 256 to 16.
I had this *working* on the Mac, but made the mistake when I
copied it to the machine whence I send mail. Sorry.
Note that the version that made a string was copied correctly.
More information about the Squeak-dev
mailing list
|