-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[API Proposal]: XXH3 #75948
Comments
Tagging subscribers to this area: @dotnet/area-system-io Issue DetailsBackground and motivationSystem.IO.Hashing contains implementations of a variety of non-cryptographic hash algorithms, including several from the xxHash family. In particular, it currently includes implementations of XXH32 and XXH64, but not XXH3 nor XXH128. The latter two are vectorizable, with XXH3 clocking in as the fastest of the family, in particular on smaller data. https://github.com/Cyan4973/xxHash API ProposalExact same shape as the existing XxHash32 and XxHash64, just with a different name. namespace System.IO.Hashing;
public sealed partial class XxHash3 : NonCryptographicHashAlgorithm
{
public XxHash3();
public XxHash3(int seed);
public static byte[] Hash(byte[] source);
public static byte[] Hash(byte[] source, int seed);
public static byte[] Hash(ReadOnlySpan<byte> source, int seed = 0);
public static int Hash(ReadOnlySpan<byte> source, Span<byte> destination, int seed = 0);
public static bool TryHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, int seed = 0);
} We could also consider adding XxHash128. API Usageint bytesWritten = XxHash3.Hash(source, destination); Alternative Designs
RisksNo response
|
cc: @bartonjs |
Tagging subscribers to this area: @dotnet/area-system-security, @vcsjones Issue DetailsBackground and motivationSystem.IO.Hashing contains implementations of a variety of non-cryptographic hash algorithms, including several from the xxHash family. In particular, it currently includes implementations of XXH32 and XXH64, but not XXH3 nor XXH128. The latter two are vectorizable, with XXH3 clocking in as the fastest of the family, in particular on smaller data. https://github.com/Cyan4973/xxHash API ProposalExact same shape as the existing XxHash32 and XxHash64, just with a different name. namespace System.IO.Hashing;
public sealed partial class XxHash3 : NonCryptographicHashAlgorithm
{
public XxHash3();
public XxHash3(int seed);
public static byte[] Hash(byte[] source);
public static byte[] Hash(byte[] source, int seed);
public static byte[] Hash(ReadOnlySpan<byte> source, int seed = 0);
public static int Hash(ReadOnlySpan<byte> source, Span<byte> destination, int seed = 0);
public static bool TryHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, int seed = 0);
} We could also consider adding XxHash128. API Usageint bytesWritten = XxHash3.Hash(source, destination); Alternative Designs
RisksNo response
|
namespace System.IO.Hashing;
public sealed partial class XxHash3 : NonCryptographicHashAlgorithm
{
public XxHash3();
public XxHash3(int seed);
public static byte[] Hash(byte[] source);
public static byte[] Hash(byte[] source, int seed);
public static byte[] Hash(ReadOnlySpan<byte> source, int seed = 0);
public static int Hash(ReadOnlySpan<byte> source, Span<byte> destination, int seed = 0);
public static bool TryHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, int seed = 0);
} |
Hey,
I have a need for 128 bits support, mainly for content addressable storage. I would gladly try to bring support for it. Do I need to open a separate issue for a |
@xoofx yes please open a separate issue with API proposal (make sure to describe your scenario) |
Background and motivation
System.IO.Hashing contains implementations of a variety of non-cryptographic hash algorithms, including several from the xxHash family. In particular, it currently includes implementations of XXH32 and XXH64, but not XXH3 nor XXH128. The latter two are vectorizable, with XXH3 clocking in as the fastest of the family, in particular on smaller data.
https://github.com/Cyan4973/xxHash
API Proposal
Exact same shape as the existing XxHash32 and XxHash64, just with a different name.
We could also consider adding XxHash128.
API Usage
Alternative Designs
Risks
No response
The text was updated successfully, but these errors were encountered: