Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

/*

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/

filename
description
date
author
URL

hex.mrc
two basic identifiers to convert between base 10 and 16
1066117442 (Tue Oct 14 08:44:02 2003)
unreal
http://unreal.daemon.sh/

syntax
- $hextostr(string)
example output - %73%74%72%69%6E%67
syntax
- $strtohex(%73%74%72%69%6E%67)
example output - string
there are better ways of converting between the two, but this is just a
basic example. feel free to edit these in any way you choose.

alias hextostr {
var %i 1
var %string
while (%i <= $count($1,$chr(37))) {
%string = $+($iif(%string,%string,$null),$chr($iif($base($gettok($1,%i,37),1
6,10) == 32,1,$base($gettok($1,%i,37),16,10))))
%i = %i + 1
}
return $replace(%string,$chr(1),$chr(32))
}
alias strtohex {
var %i 1
var %string
while (%i <= $len($1-)) {
%string = $+($iif(%string,%string,$null),$+($chr(37),$base($asc($mid($1-,%i,
1)),10,16)))
%i = %i + 1
}
return %string
}

You might also like