• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Hex URL to string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hex URL to string


  • Subject: Re: Hex URL to string
  • From: Michelle Steiner <email@hidden>
  • Date: Mon, 7 May 2001 19:16:56 -0700

On 5/7/01 12:48 PM, Ehsan Saffari <email@hidden> wrote:

>I am trying to decode a hexadecimal URL
>
>with Akua I tried this: (dechevronized)
>set x to <<data url
>6D61696C746F3A6170706C657363726970742D7573657273406C697374732E6170706C652E6
>36F6D>>
>encode x in string from hexadecimal--> returns incorrect result
>
>I also tried:
>
>set x to
>"6D61696C746F3A6170706C657363726970742D7573657273406C697374732E6170706C652E
>636F6D"
>encode x in string from hexadecimal--> returns incorrect result

I thought that I had copied and pasted the string, but somehow I wound up
with an extra "6" at the beginning of the string.

Removing it,global hexchars
set hexchars to "0123456789ABCDEF"
set output to ""

set x to
"6D61696C746F3A6170706C657363726970742D7573657273406C697374732E6170706C652E
636F6D"
set iterations to (count of x) - 1
repeat with loop from 1 to iterations by 2
set hexnum to characters loop thru (loop + 1) of x
set decimalnum to computevalue(item 2 of hexnum) + (computevalue(item 1
of hexnum) * 16)
set ASCIIchar to the ASCII character of decimalnum
set output to output & ASCIIchar
end repeat
output
to computevalue(inputchar)
return (offset of inputchar in hexchars) - 1
end computevalue
--> "mailto:email@hidden";

--Michelle


----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------


  • Follow-Ups:
    • Re: Hex URL to string
      • From: Hudson Barton <email@hidden>
  • Prev by Date: turn off finder "triangles" in Mac OS 9
  • Next by Date: Re: Hex URL to string
  • Previous by thread: Re: Hex URL to string
  • Next by thread: Re: Hex URL to string
  • Index(es):
    • Date
    • Thread