Routines for review: Hex <-> String
Routines for review: Hex <-> String
- Subject: Routines for review: Hex <-> String
- From: julifos <email@hidden>
- Date: Fri, 17 Jan 2003 13:18:26 +0100
Hi all!
Perhaps these routines already exists, but I did not find them, so...
I'd like to know if this works in other computer different than the mine (AS
1.9.1, OS 10.2.3)
;-)
JJ
-- / . / . / . / . / . / . / . / . / . / . / . / . / . / . / . / . / . / . /
-- / . NOTE BREAK LINES & LEFT-RIGTH ANGLE QUOTES . /
-- / . / . / . / . / . / . / . / . / . / . / . / . / . / . / . / . / . / . /
set h to "48656C6C6F2C20446F6C6C79"
hextoString(h)
stringtoHex(result) = h
on stringtoHex(this_string)
this_string as C string
try
result * 5
on error msg
return text from character 22 of msg to character -19 of msg
end try
end stringtoHex
on hextoString(t)
set z to ""
repeat with i from 1 to t's length by 252
try
set z to z & (run script "<<data cstr" & t's characters i thru
(i + 251) & "00>> as string")
on error
set z to z & (run script "<<data cstr" & t's characters i thru
-1 & "00>> as string")
end try
end repeat
z
end hextoString
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.