alias asc2bin return $dec2bin($asc($1)) alias asc2hex return $dec2hex($asc($1)) alias bin2asc return $chr($bin2dec($1)) alias bin2hex return $dec2hex($bin2dec($1)) alias hex2asc return $chr($hex2dec($1)) alias hex2bin return $dec2bin($hex2dec($1)) alias bin2dec { var %l $len($1),%e 0,%r while (%l) { if ($mid($1,%l,1)) { inc %r $calc(2^ %e) } inc %e dec %l } return %r } alias dec2bin { var %o = $1,%r while (%o) || ($calc($len(%r) % 8)) { %r = $calc(%o % 2) $+ %r %o = $int($calc(%o /2)) } return %r } alias dec2hex { var %o $1,%r while (%o >= 16) { %r = $->hex($calc(%o % 16)) $+ %r %o = $int($calc(%o /16)) } return $->hex(%o) $+ %r } alias hex2dec { var %l $len($1),%e 0,%r while (%l) { inc %r $calc($<-hex($mid($1,%l,1)) * 16 ^ %e) inc %e dec %l } return %r } ;local identifiers alias -l ->hex return $gettok(0 1 2 3 4 5 6 7 8 9 A B C D E F,$calc($1 +1),32) alias -l <-hex return $iif($1 isnum,$1,$calc($asc($1)-55))