Update xhttp

This commit is contained in:
Shtorm
2026-02-22 14:48:52 +03:00
parent 9e4eb52a82
commit a3aaf2cb92
9 changed files with 863 additions and 104 deletions

View File

@@ -85,10 +85,14 @@ func ParseString(str string) (UUID, error) {
b := uuid.Bytes()
for _, byteGroup := range byteGroups {
if text[0] == '-' {
if len(text) > 0 && text[0] == '-' {
text = text[1:]
}
if len(text) < byteGroup {
return uuid, E.New("invalid UUID: ", str)
}
if _, err := hex.Decode(b[:byteGroup/2], text[:byteGroup]); err != nil {
return uuid, err
}