From d59e434200896d260fe8a5e7efeafe107caeea1d Mon Sep 17 00:00:00 2001 From: Mykhailo Matviiv Date: Fri, 9 Aug 2024 01:50:51 +0200 Subject: [PATCH] Fix buffer slicing on UUID generation --- src/FastIDs.TypeId/TypeId.Core/Uuid/UuidGenerator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FastIDs.TypeId/TypeId.Core/Uuid/UuidGenerator.cs b/src/FastIDs.TypeId/TypeId.Core/Uuid/UuidGenerator.cs index 0ec9dfc..d31aaa3 100644 --- a/src/FastIDs.TypeId/TypeId.Core/Uuid/UuidGenerator.cs +++ b/src/FastIDs.TypeId/TypeId.Core/Uuid/UuidGenerator.cs @@ -30,7 +30,7 @@ public Guid New() SetTimestamp(buffer[..8], timestamp); // Using full buffer because we need to account for two zero-bytes in front. RandomNumberGenerator.Fill(idBytes[8..]); - return GuidConverter.CreateGuidFromBigEndianBytes(buffer); + return GuidConverter.CreateGuidFromBigEndianBytes(buffer[2..]); } // The implementation copied from DateTimeOffset.ToUnixTimeMilliseconds()