[REBOL] [REBOL]Hex decoding Re:(2)

2000-04-24 Thread tjohnson

Hi: I tried a different approach,
which now works. I will set up both
approaches, and submit them to the
list and see if I get input on the
most efficient approach. 
Thank you much!
tim
At 10:28 AM 4/24/00 +0100, you wrote:
>Hi, REBOL can do it all, although with some type conversions.
>
>Encoding, step by step:
>
>>> string: "this is a string"
>== "this is a string"
>>> binary: to-binary string
>== #{74686973206973206120737472696E67}
>>> binary-as-string: form binary
>== "#{74686973206973206120737472696E67}"
>>> hex-string: copy next next head remove back tail binary-as-string
>== "74686973206973206120737472696E67"
>
>Decoding, step by step:
>
>>> binary-as-string-again: join "#{" [ hex-string "}" ]
>== "#{74686973206973206120737472696E67}"
>>> binary-again: do binary-as-string-again
>== #{74686973206973206120737472696E67}
>>> string-again: to-string binary-again
>== "this is a string"
>
>-- 
>Michal Kracik
>
>[EMAIL PROTECTED] wrote:
>> 
>> Hello all:
>> I'm trying to set up a system for encoding
>> a string into a target string that represents
>> the hex values of the original string.
>> I've got the encoding set up. Now I want
>> to decode the string:
>> So here's where I run into a dead-end.
>> 
>> I have a 2-byte string: value is "74"
>> 
>> I want to convert this value to a 't'
>> 
>> hint : 't' is ascii 116
>> 
>> 116 is hex 74;
>> 
>> de-hex doesn't do it. I'm trying to write
>> a variation of de-hex.
>> 
>> Thanks for the help as always!!
>> Tim
>
>




[REBOL] [REBOL]Hex decoding Re:(2)

2000-04-24 Thread tjohnson

Thanks: I'm still a newbie... but I
actually thought of that myself later. Thank
you very much for the help!
regards
tim
At 06:05 AM 4/24/00 +0100, you wrote:
>
>
>hex2str: func[a][  dehex join "%" a  ]
>
>> I have a 2-byte string: value is "74"
>> 
>> I want to convert this value to a 't'
>> 
>> hint : 't' is ascii 116
>> 
>> 116 is hex 74;
>> 
>> de-hex doesn't do it. I'm trying to write
>> a variation of de-hex.
>> 
>> Thanks for the help as always!!
>> Tim
>> 
>
>Volker
> 
>
>