From 9f6677f1747adbece466f98edac0e29fafbd9174 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 13 Jan 2026 21:33:26 +0100 Subject: [PATCH] global-functions: deprecate $HexToNum --- global-functions.d/deprecated.rsc | 15 +++++++++++++++ global-functions.rsc | 14 -------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/global-functions.d/deprecated.rsc b/global-functions.d/deprecated.rsc index fe492098..d03c7d36 100644 --- a/global-functions.d/deprecated.rsc +++ b/global-functions.d/deprecated.rsc @@ -7,3 +7,18 @@ # # deprecated global functions # https://rsc.eworm.de/ + +:global HexToNum; + +# 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) ]; +} diff --git a/global-functions.rsc b/global-functions.rsc index 8150b163..79a7be8a 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -49,7 +49,6 @@ :global GetRandom20CharHex; :global GetRandomNumber; :global Grep; -:global HexToNum; :global HumanReadableNum; :global IfThenElse; :global IsDefaultRouteReachable; @@ -735,19 +734,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 ];