V2Ray : Support Xray UUIDv5 mapping standard

This commit is contained in:
Hellojack
2022-06-10 14:21:53 +08:00
committed by GitHub
parent 98ece46832
commit d3582340b0
3 changed files with 38 additions and 3 deletions

View File

@@ -82,7 +82,7 @@ public static class V2rayConfigUtils
{
new User
{
id = vless.UserID,
id = getUUID(vless.UserID),
flow = vless.Flow.ValueOrDefault(),
encryption = vless.EncryptMethod
}
@@ -125,7 +125,7 @@ public static class V2rayConfigUtils
{
new User
{
id = vmess.UserID,
id = getUUID(vmess.UserID),
alterId = vmess.AlterID,
security = vmess.EncryptMethod
}
@@ -366,4 +366,13 @@ public static class V2rayConfigUtils
return streamSettings;
}
public static string getUUID(string uuid)
{
if (uuid.Length == 36 || uuid.Length == 32)
{
return uuid;
}
return uuid.GenerateUUIDv5();
}
}