mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-06-26 19:58:48 +02:00
global-functions: $HexToNum: properly handle capital characters
This commit is contained in:
parent
1ce0f63ef7
commit
c60c96e32a
1 changed files with 2 additions and 2 deletions
|
@ -429,12 +429,12 @@
|
|||
# convert from hex (string) to num
|
||||
:set HexToNum do={
|
||||
:local Input [ :tostr $1 ];
|
||||
:local Hex "0123456789abcdef";
|
||||
:local Hex "0123456789abcdef0123456789ABCDEF";
|
||||
:local Multi 1;
|
||||
:local Return 0;
|
||||
|
||||
:for I from=([ :len $Input ] - 1) to=0 do={
|
||||
:set Return ($Return + ([ :find $Hex [ :pick $Input $I ] ] * $Multi));
|
||||
:set Return ($Return + (([ :find $Hex [ :pick $Input $I ] ] % 16) * $Multi));
|
||||
:set Multi ($Multi * 16);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue