mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-01-27 11:29:34 +00:00
24 lines
523 B
Text
24 lines
523 B
Text
#!rsc by RouterOS
|
|
# RouterOS script: global-functions.d/deprecated
|
|
# Copyright (c) 2013-2026 Christian Hesse <mail@eworm.de>
|
|
# https://rsc.eworm.de/COPYING.md
|
|
#
|
|
# requires RouterOS, version=7.17
|
|
#
|
|
# 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) ];
|
|
}
|