feat: VMess/VLESS 校验 uuid

This commit is contained in:
xream
2025-02-10 13:34:58 +08:00
parent 8ecfeed953
commit 08e6835c2d
3 changed files with 38 additions and 6 deletions

View File

@@ -117,7 +117,17 @@ function numberToString(value) {
: BigInt(value).toString();
}
function isValidUUID(uuid) {
return (
typeof uuid === 'string' &&
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
uuid,
)
);
}
export {
isValidUUID,
ipAddress,
isIPv4,
isIPv6,