Last active
May 3, 2020 19:03
-
-
Save bryc/ed61324c75da5c3bfa5ef00a4daa3782 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
for(rnd=w=>'#'+Math.random().toString(16).slice(-6),i=0;i<99;i++) | |
document.write(`<div style=background:linear-gradient(0.25turn,${rnd()},${rnd()},${rnd()},${rnd()})></div>`) | |
</script> | |
<style>body{background:#222;column-count:3;column-gap:6px}div{height:48;break-inside:avoid}</style> | |
<!-- | |
background: repeating-linear-gradient(45deg, #3f87a6, #ebf8e1 5%, #f69d3c 20%); | |
clip-path: polygon(5% 5%, 100% 0%, 100% 75%, 75% 75%, 75% 100%, 50% 75%, 0% 75%); | |
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
body{background:#000;} | |
div{display:inline-block;} | |
</style> | |
<div id="output"></div> | |
<script> | |
//transform:rotate(45deg); | |
rnd = w=>'#'+Math.random().toString(16).slice(-6) | |
clip = [ | |
"polygon(0 100%, 50% 0, 0 0)", | |
"polygon(0 100%, 100% 0, 0 0)", | |
"polygon(0 50%, 50% 0, 0 0)", ////// | |
"polygon(50% 50%, 0 0, 0 100%)", | |
"polygon(100% 100%, 50% 0, 0 100%)", | |
"polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)" | |
] | |
function gen() { | |
var z = document.querySelector("div#output"); | |
//z.innerHTML = ""; | |
var ss = ""; | |
for(i = 0; i < 69; i++) { | |
ss += ` | |
<div style='margin:4px;width:96px;height:96px;overflow:hidden;text-align:center;vertical-align:top;filter: contrast(150%) saturate(50%);background:#FFF')> | |
<div style='width:100%;height:100%;'> | |
<div style='height:100%;width:100%;clip-path:${clip[Math.random()*clip.length|0]};background:#000 linear-gradient(${Math.random()}turn,${rnd()+"60"},${rnd()+"60"},${rnd()+"60"},${rnd()+"60"}')></div> | |
</div> | |
</div> | |
` | |
} | |
z.innerHTML = ss; | |
} | |
gen() | |
window.onclick = gen | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- COLOR CODING FOR BINARY DECODE OF FM INSTRUMENT DATA --> | |
<style> | |
body{background:#011113;color:#FFFB} | |
pre{ | |
background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABBIAAAABCAMAAABUi33SAAAAMFBMVEXYwwAUFP8A/wD/AAAAAAD/PwDX2wDXhoLYYbwAAAA1qACTUtgAftgA2IXYfgDYACSls45SAAAAEHRSTlN/f39/AH9/f39/f39/f39/k8ZVKAAAAEdJREFUeNrNzsUVwEAQw9AwQ//d5upxlvkXoKdO6NGARjBJsz8qtPCwaK1bNs4POzoAFQ50OqHC5Y8Kt78GHx5/VHj9tfDwflfXIpDws3x4AAAAAElFTkSuQmCC'); | |
display:inline-block; | |
line-height:1; | |
font-size:24px; | |
margin:0; | |
} | |
pre#h{color:#FFF;font-weight:bold;background-color:#000} | |
pre#r{background-color:#444} | |
</style> | |
<pre id=h> | |
MMMM MMMM CCCC CCCC MMMM MMMM CC-C MMMM MMMM MMMM CCCC CCCC MMMM MMMM CCCC CCCC | |
TVSK MMMM TVSK MMMM KKOO OOOO KK-Q WFFF AAAA DDDD AAAA DDDD SSSS RRRR SSSS RRRR</pre> | |
<br><pre id=r> | |
</pre> | |
<script> | |
function doitt(asd) { | |
var data = asd.split(" ").map(x=>parseInt(x,16)); | |
var str = ""; | |
for(var i = 0; i < data.length; i++) str+= ((data[i]&0b11110000)>>4).toString(2).padStart(4, "0")+" "+(data[i]&0b1111).toString(2).padStart(4, "0")+"|"; | |
return str; | |
} | |
var strs = | |
`21 72 0D 00 C1 D5 56 06 | |
21 72 0D 00 C1 A0 54 16 | |
`; | |
strs = strs.split("\n"); | |
strs.pop(); | |
var out = ""; | |
for(var i = 0; i < strs.length; i++) out += doitt(strs[i]) + "\n"; | |
document.querySelector("pre#r").innerHTML = out; | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HASH/CHECKSM STUFF | |
function bsd8(data) { | |
for(var i = 0, c = 0; i < data.length; i++) { | |
c = (c>>>1) + ((c&1) << 7); | |
c += data[i]; | |
c &= 0xff; | |
} | |
return c; | |
} | |
function bsd82(data) { | |
for(var i = 0, c = 0; i < data.length; i++) { | |
c = (c>>>1) | (c << 7); | |
c += data[i]; | |
c &= 0xff; | |
} | |
return c; | |
} | |
for(var i = 0; i < 2**15; i++) { | |
data = new Uint8Array(65536 - Math.random()*2**16-1|0); | |
window.crypto.getRandomValues(data); | |
console.log( | |
bsd8(data) === bsd82(data) | |
) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- THEORETICAL VIDEO GAME PASSWORD GENERATOR --> | |
<style> | |
h1 { | |
font-family:Courier New; | |
font-size: 160px; | |
background: -webkit-linear-gradient(red, #CCC); | |
-webkit-background-clip: text; | |
-webkit-text-fill-color: transparent; -webkit-text-stroke-width: 3px; | |
-webkit-text-stroke-color: black; | |
letter-spacing:24px;text-align:center; | |
line-height:132px; | |
filter: drop-shadow(2px 2px 1px #000A); | |
} | |
</style> | |
<h1></h1> | |
<script> | |
var char="123456789ABCDEFGHJKLMNOPQRTVWXYZ"; | |
//for(var i = 0; i < 4; i++) { | |
// var rand = Math.random()*32|0; | |
function gen() { return Array(4).fill("").map(a=>char[Math.random()*32|0]).join('')} | |
function gen2() { document.querySelector("h1").innerHTML = `${gen()}<br>${gen()}<br>${gen()}`; } | |
gen2() | |
setInterval(gen2, 1000) | |
//} | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HASH AND PRNG C CODE STUFF | |
mod 255 sum + sll (sum first) | |
mod 255 sum + sll | |
mod 255 sum + rol | |
bsd-8 | |
41 42 43 | 99, CC, CD, B4, 66 | |
41 43 42 | 9B, CD, CE, 33, 64 | |
42 41 43 | 9D, CE, CF, 74, 62 | |
42 43 41 | A1, D0, D1, 73, 5E | |
43 42 41 | A5, D2, D3, 32, 5A | |
43 41 42 | A3, D1, D2, B3, 5C | |
FC 28 02 | |
FC 02 28 | |
28 FC 02 | |
28 02 FC | |
02 FC 28 | |
02 28 FC | |
00 00 DE AD BE EF 00 00 00 00 00 | |
00 00 00 DE AD BE EF 00 00 00 00 | |
x, y, z, w | |
function xorshift128plus_32a(state) { | |
return function() { | |
var x, y, z, w, t; | |
x = state[0]; | |
y = state[1]; | |
z = state[2]; | |
w = state[3]; | |
t = w + y + (x !== 0 && z >= (-x>>>0) ? 1 : 0); | |
y ^= (y << 23) | (x >>> 9); | |
x ^= x << 23; | |
state[0] = z; | |
state[1] = w; | |
state[2] = x ^ z ^ ((x >>> 18) | (y << 14)) ^ ((z >>> 5) | (w << 27)); | |
state[3] = y ^ w ^ (y >>> 18) ^ (w >>> 5); | |
return t>>>0; | |
} | |
} | |
uint32_t xorshift128plus_32(uint32_t *state) { | |
uint32_t x, y, z, w, t; | |
x = state[0]; | |
y = state[1]; | |
z = state[2]; | |
w = state[3]; | |
t = w + y + (x != 0 && z >= -x ? 1 : 0); | |
y ^= (y << 23) | (x >> 9); | |
x ^= x << 23; | |
state[0] = z; | |
state[1] = w; | |
state[2] = x ^ z ^ ((x >> 18) | (y << 14)) ^ ((z >> 5) | (w << 27)); | |
state[3] = y ^ w ^ (y >> 18) ^ (w >> 5); | |
return t; | |
} | |
https://github.com/umireon/my-random-stuff/tree/master/xorshift |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment