MCPcopy Create free account
hub / github.com/F-Stack/f-stack / DiB_rand

Function DiB_rand

freebsd/contrib/zstd/programs/dibio.c:148–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146
147#define DiB_rotl32(x,r) ((x << r) | (x >> (32 - r)))
148static U32 DiB_rand(U32* src)
149{
150 static const U32 prime1 = 2654435761U;
151 static const U32 prime2 = 2246822519U;
152 U32 rand32 = *src;
153 rand32 *= prime1;
154 rand32 ^= prime2;
155 rand32 = DiB_rotl32(rand32, 13);
156 *src = rand32;
157 return rand32 >> 5;
158}
159
160/* DiB_shuffle() :
161 * shuffle a table of file names in a semi-random way

Callers 1

DiB_shuffleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected