return false
end
-function uint(val)
+function uinteger(val)
local n = tonumber(val)
if n ~= nil and math.floor(n) == n and n >= 0 then
return true
return false
end
-function int(val)
+function integer(val)
local n = tonumber(val)
if n ~= nil and math.floor(n) == n then
return true
return false
end
+function ufloat(val)
+ local n = tonumber(val)
+ return ( n ~= nil and n >= 0 )
+end
+
function float(val)
return ( tonumber(val) ~= nil )
end
if (#val == 10) or (#val == 26) then
return (val:match("^[a-fA-F0-9]+$") ~= nil)
else
- return (#v == 5) or (#v == 13)
+ return (#val == 5) or (#val == 13)
end
end
function uciname(val)
return (val:match("^[a-zA-Z0-9_]+$") ~= nil)
end
+
+function range(val, min, max)
+ val = tonumber(val)
+ min = tonumber(min)
+ max = tonumber(max)
+
+ if val ~= nil and min ~= nil and max ~= nil then
+ return ((val >= min) and (val <= max))
+ end
+
+ return false
+end