global-functions: deprecate $HexToNum

This commit is contained in:
Christian Hesse 2026-05-20 09:07:04 +02:00
parent 22cff60d2b
commit 8f26163270
2 changed files with 14 additions and 14 deletions

View file

@ -8,8 +8,22 @@
# deprecated global functions
# https://rsc.eworm.de/
:global HexToNum;
:global UrlEncode;
# convert from hex (string) to num
:set HexToNum do={
:local Input [ :tostr $1 ];
:global HexToNum;
:if ([ :pick $Input 0 ] = "*") do={
:return [ $HexToNum [ :pick $Input 1 [ :len $Input ] ] ];
}
:return [ :tonum ("0x" . $Input) ];
}
# url encoding
:set UrlEncode do={
:local Input [ :tostr $1 ];