Conversion issue
Andre Silva
Junior Member
Hello,
I would like to know if it's possible to do a conversion ignoring the conversion (?)
What I mean is:
$19 (Hexadecimal) = 19 (ASCII)
I need this because of a genius who wrote a checksum that simply ignore the usual conversion and uses $19 as 19 ASCII.
Thank you.
Regards,
André Roberto
I would like to know if it's possible to do a conversion ignoring the conversion (?)
What I mean is:
$19 (Hexadecimal) = 19 (ASCII)
I need this because of a genius who wrote a checksum that simply ignore the usual conversion and uses $19 as 19 ASCII.
Thank you.
Regards,
André Roberto
Comments
-
http://www.amxforums.com/showthread.php?8744-Hex-value-to-Integer&highlight=conversion <- This is the solution. Thank you DHawthorne
-
I had to do the same thing for a wierd protocol, this is java code translated on the fly so it might need some tweaking and I have only used it with values from 0 - 99.
DEFINE_FUNCTION CHAR encodeValue(INTEGER value) { if (value >= 0 AND value < 100) { RETURN TYPE_CAST((value/10) << 4) BOR TYPE_CAST(value % 10) } RETURN 0 } DEFINE_FUNCTION INTEGER decodeValue(CHAR value) { RETURN TYPE_CAST((((value & $F0) >> 4) * 10) + (value & $0F)) }
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums