MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / hash

Function hash

Source/Utils/SimplexNoise.cpp:100–102  ·  view source on GitHub ↗

* Helper function to hash an integer using the above permutation table * * This inline function costs around 1ns, and is called N+1 times for a noise of N dimension. * * Using a real hash function would be better to improve the "repeatability of 256" of the above permutation table, * but fast integer Hash functions uses more time and have bad random properties. * * @param[in] i Integer va

Source from the content-addressed store, hash-verified

98 * @return 8-bits hashed value
99 */
100static inline uint8_t hash(int32_t i) {
101 return perm[static_cast<uint8_t>(i)];
102}
103
104/* NOTE Gradient table to test if lookup-table are more efficient than calculs
105static const float gradients1D[16] = {

Callers 3

noiseXMethod · 0.70
noiseXYMethod · 0.70
noiseXYZMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected