mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralsec.git
synced 2025-11-03 20:27:45 +00:00
Signed-off-by: stephb9959 <stephane.bourque@gmail.com>
This commit is contained in:
@@ -132,6 +132,15 @@ namespace OpenWifi::Utils {
|
||||
return std::regex_match(Hostname, HostNameRegex);
|
||||
}
|
||||
|
||||
[[nodiscard]] bool ValidNumber(const std::string &number, bool isSigned)
|
||||
{
|
||||
static std::regex IntRegex("^-?[0-9]\\d*(\\.\\d+)?$");
|
||||
if(!isSigned) {
|
||||
IntRegex = "^[0-9]\\d*(\\.\\d+)?$";
|
||||
}
|
||||
return std::regex_match(number, IntRegex);
|
||||
}
|
||||
|
||||
[[nodiscard]] std::string ToHex(const std::vector<unsigned char> &B) {
|
||||
std::string R;
|
||||
R.reserve(B.size() * 2);
|
||||
|
||||
Reference in New Issue
Block a user