Skip to content

Commit 736682f

Browse files
Anna's nice to haves
1 parent cf143ac commit 736682f

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/binary.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,6 @@ export class UUID extends Binary {
353353
}
354354
}
355355

356-
/**
357-
* Generate a 16 byte uuid v4 buffer used in UUIDs
358-
*/
359-
360356
/**
361357
* Returns the UUID id as a 32 or 36 character hex string representation, excluding/including dashes (defaults to 36 character dash separated)
362358
* @param includeDashes - should the string exclude dash-separators.
@@ -455,13 +451,7 @@ export class UUID extends Binary {
455451
return false;
456452
}
457453

458-
try {
459-
// get this byte as hex: xxxxxxxx-xxxx-XXxx-xxxx-xxxxxxxxxxxx
460-
// check first part as uuid version: xxxxxxxx-xxxx-Xxxx-xxxx-xxxxxxxxxxxx
461-
return parseInt(input[6].toString(16)[0], 10) === Binary.SUBTYPE_UUID;
462-
} catch {
463-
return false;
464-
}
454+
return (input[6] & 0xf0) === 0x40;
465455
}
466456

467457
return false;

0 commit comments

Comments
 (0)