Smalltalk beginner

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Smalltalk beginner

Randy Coulman-2
This might sound a strange question, but...

I've been learning smalltalk for about a year now and want to know if there is
a method for converting string (text) into binary (for use with an encryption
routine I want to develop)?


Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk beginner

Christopher J. Demers
"Gary D." <[hidden email]> wrote in message
news:[hidden email]...
> I've been learning smalltalk for about a year now and want to know if
> there is
> a method for converting string (text) into binary (for use with an
> encryption
> routine I want to develop)?

Look at the method String<<asByteArray.

for example:
===============
aString := 'This is a string.'.
aByteArray := aString asByteArray.
===============

Dolphin also has some built-in cryptographic methods, so you way want to
take a look at those to see if they might suite your needs.  Look at the
PC1Cipher class side example methods.

Chris


Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk beginner

Schwab,Wilhelm K
In reply to this post by Randy Coulman-2
Gary,
> This might sound a strange question, but...

It's a fine question.  Below is a strange answer :)

> I've been learning smalltalk for about a year now and want to know if there is
> a method for converting string (text) into binary (for use with an encryption
> routine I want to develop)?

You might not need to bother.  When making external calls, Dolphin
automatically passes some objects by address.  It generally just works.
  Blair has expressed some regret over it because it occaisionally
causes trouble, but IMHO, it helps far more often than it hurts.  The
only trouble scenario I recall was a COM component that relayed
pointers; I had to wrap the pointer in an external integer, and pass it
rather than sending the pointer straight through as one would expect to
do.  For things like encryption, you will find the calling conventions
quite helpful.

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]