Skip to content

Commit

Permalink
sizeof(ulong) vs size(long)
Browse files Browse the repository at this point in the history
  • Loading branch information
halgari committed Dec 16, 2024
1 parent 752486b commit 6815ce4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Abstractions/NexusMods.Abstractions.Hashes/MultiHasher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ public static async Task MinimalHash(XxHash3 hasher, Stream stream, Cancellation
await stream.ReadExactlyAsync(buffer, cancellationToken);
hasher.Append(buffer.Span);

// Add the length of the file to the hash (as a ulong)
Span<byte> lengthBuffer = stackalloc byte[sizeof(long)];
// Add the length of the file to the hash (as an ulong)
Span<byte> lengthBuffer = stackalloc byte[sizeof(ulong)];
MemoryMarshal.Write(lengthBuffer, (ulong)stream.Length);
hasher.Append(lengthBuffer);
}
Expand Down

0 comments on commit 6815ce4

Please sign in to comment.