Skip to content

Instantly share code, notes, and snippets.

View jonathancore's full-sized avatar

Jonathan Core jonathancore

  • Moore, OK
View GitHub Profile
@jonathancore
jonathancore / mash.js
Created August 1, 2022 21:34
Hash string to 32bit integer. Good for seeding prngs while also working as a tolerable prng itself.
'not sure who original author was. possibly Baggoe
function Mash() {
const initialize = 0xefc8249d;
let first = true;
return (seed = ' ', reset = first) => {
if(reset) [n, first] = [initialize, false];
seed = String(seed);
let i = seed.length;
while (i--) {
//Basically, getting a value from each characters charCode, multiplying by a magic number,
@jonathancore
jonathancore / LICENSE.txt
Created April 27, 2016 00:21 — forked from aemkei/LICENSE.txt
Binary Tetris - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE