MetroHash | Simple C # port of MetroHash | Hashing library
kandi X-RAY | MetroHash Summary
kandi X-RAY | MetroHash Summary
This is a direct port of J. Andrew Rogers' Metro Hash 128 algorithm. Compare
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of MetroHash
MetroHash Key Features
MetroHash Examples and Code Snippets
Community Discussions
Trending Discussions on MetroHash
QUESTION
I'm using yarn
to install packages including asset-hash, which depends on metrohash.
I constantly run in the following error:
...ANSWER
Answered 2021-Mar-02 at 17:24With the help of a colleague I could fix the error.
I had to uninstall brew and reinstall it using Rosetta. Then I reinstalled node and yarn also using the Terminal in Rosetta mode.
QUESTION
I'm currently looking at porting my metro hash implementon to use C#7 features, as several parts might profit from ref locals to improve performance.
The hash does the calculations on a ulong[4]
array, but the result is a 16 byte
array. Currently I'm copying the ulong
array to the result byte
buffer, but this takes a bit of time.
So i'm wondering if System.Runtime.CompilerServices.Unsafe
is safe to use here:
ANSWER
Answered 2017-Jun-16 at 21:45C# supports "fixed buffers", here's the kind of thing we can do:
QUESTION
I have an input of 288 bits (comprising 4 × 32-bit identity function outputs and 10 × 16-bit integers). I need to hash this to 96 bits with as few collisions as possible. The goal could be stated as key compression with probabilistic collisions.
I'm aware that CRC is a bijective hash, thus ensuring 100% even distribution (as I understand it). In my view, I should be able to run 3 parallel CRC paths through the input, resulting in a 96-bit lossy hash (obviously not bijective) of optimum distribution.
However, I'm also aware that CRC is not used for such applications. An algorithm such as MetroHash would typically be used.
Could someone explain to me why CRC is a bad (or not) idea for this application?
Note: This is not intended for anything secure.
...ANSWER
Answered 2017-Dec-03 at 17:49Sure, that can work, but there are probably better approaches.
For it to work, you would need to use three different CRC-32's with three different polynomials. And even then, be careful that they don't have common factors (e.g. x+1), to make sure that there are no correlated bits between the three.
Better would be an approach like used in xxhash, but extended to 96 bits. That would be faster in software.
Why 96 bits? That seems like an unnecessarily long hash.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install MetroHash
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page