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 ];

View file

@ -49,7 +49,6 @@
:global GetRandom20CharHex;
:global GetRandomNumber;
:global Grep;
:global HexToNum;
:global HumanReadableNum;
:global IfThenElse;
:global IsDefaultRouteReachable;
@ -743,19 +742,6 @@
:return [];
}
# 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) ];
}
# return human readable number
:set HumanReadableNum do={
:local Input [ :tonum $1 ];