Mirror of https://github.com/roostorg/coop github.com/roostorg/coop
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 9 lines 330 B view raw
1export function seededRandom(seed: string) { 2 const hashFromSeed = seed.split('').reduce(function (a, b) { 3 a = (a << 5) - a + b.charCodeAt(0); 4 return a & a; 5 }, 0); 6 // Adapted from http://indiegamr.com/generate-repeatable-random-numbers-in-js/ 7 const x = Math.sin(hashFromSeed) * 10000; 8 return x - Math.floor(x); 9}