Skip to content

Commit

Permalink
Add a comment about xorshift (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pharap authored Sep 26, 2019
1 parent be74a34 commit 88648a6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Minesweeper/Utils/SkullHash.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

struct SkullHash
{
// This is actually part of the algorithm for an 'Xorshift' PRNG variant.
// PRNG algorithms that have a single-value state can be easily repurposed as hash functions.
// The shift values are taken from page 4 of George Marsaglia's 'Xorshift RNGs'.
// Marsaglia's 'Xorshift RNGs': https://www.jstatsoft.org/article/view/v008i14
static uint32_t hash(uint32_t value)
{
value ^= (value << 13);
Expand Down

0 comments on commit 88648a6

Please sign in to comment.