When you have your favourite playlist in random and can still predict the next song… πŸ˜¬πŸ«£πŸ™„πŸ‘€ #pseudorandom #computerscience
Just in case anyone else ever needs a #pseudorandom #Guid generator for #dotnet, here's what I finally did:

private const int guidSize = 16;
private const int guidStrLen = (guidSize * 2) + 4;
private readonly StringBuilder guidBuilder = new(guidStrLen, guidStrLen);

private string CreatePseudoRandomGuidString(Random r)
{
var bytes = new byte[guidSize];
r.NextBytes(bytes);

// Generate a valid UUID-v4 as per RFC 4122, section 4.4
bytes[6] = (byte)((bytes[6] & 0xfU) | (4U << 4)); // version 4
bytes[8] = (byte)((bytes[8] & 0x3fU) | 0x80U); // variant 1

// Format as a string. We don't use the System.Guid class here
// because it uses some mixed endian internal format which might
// not be portable.
guidBuilder.Clear();
for (int i = 0; i < guidSize; ++i)
{
guidBuilder.Append(bytes[i].ToString("x2"));
if (i % 2 != 0 && i > 2 && i < 10) guidBuilder.Append('-');
}
return guidBuilder.ToString();
}
To get a reproducable sequence of pseudo-random Guids, just seed the Random instance with a fixed value before calling this the first time.

The original Rogue level algorithm picks a width for each room between 4 and 25, and a height between 4 and 7.

Ignoring "gone" rooms, that gives 22^9 * 4^9 possibilities with only a 32-bit seed. So some combinations of rooms must be impossible! How does the subspace of rooms produced by the limited seed space compare with the theoretical distribution if rnd() was really random?

Weekend project, maybe? I have been thinking ever since #RoguelikeCelebration about how small RNG seeds (or poor PRNG algorithms) limit the expressive range of PCG in ways that might be unexpected.

#ProceduralContentGeneration #PseudoRandom #Rogue

Also no, #LavaRand is just #pseudorandom, because every #Lavalamp has a determineable cycle of blobs it'll form...

It's just that that it'll take exact info re: the filling, geometry and used bulb to be able to reconstruct and recreate the loop.

But it's a form of #pseudorandomness that is considered "sufficient"...

Tho if one uses #CloudFlare they already fucked up #ITsec so hard, they might just not use #SSL at all...

https://www.youtube.com/watch?v=1cUUfMeOijg video via @tomscott

The Lava Lamps That Help Keep The Internet Secure

At the headquarters of Cloudflare, in San Francisco, there's a wall of lava lamps: the Entropy Wall. They're used to generate random numbers and keep a good ...

YouTube

The how behind this:

1⃣ Stacking multiple semi-transparent layers increases their alpha where they overlap https://css-tricks.com/adventures-in-css-semi-transparency-land/

What the individual layers look like one under another below πŸ‘‡

Stacking them increases the overall alpha so that, in some areas, it's > .5

A bit more on the pseudo-randomness effect given by the prime number of px `background-size` https://css-tricks.com/cicada-principle-css/

#css #alpha #cssGradient #gradient #code #coding #frontend #webDev #webDevelopment #cicada #pseudoRandom

Adventures in CSS Semi-Transparency Land | CSS-Tricks

Recently, I was asked to make some tweaks to a landing page and, among the things I found in the code, there were two semitransparent overlays β€” both with the

CSS-Tricks
This year's #Turing Award winner is of course Avi Wigderson. I found this highly accessible talk by him on his work on randomness and pseudorandomness, which form the basis of much of cryptography and other parts of computers science. https://www.youtube.com/watch?v=Jz1UoAWD80Q #mathematics #computationalcomplexity #computerscience #random #pseudorandom
Avi Wigderson: Randomness and pseudorandomness

YouTube
Sometimes I think the #10PRINT algorithm can be used as a kind of #UlamSpiral to prove the quality of a #PseudoRandom number generator ...

Challenge: Given a 33 bit shift register based random number generator, shifting 32 times to make a random integer, we observe that a given value will always appear twice in the sequence. Generally unevenly spaced. How to find a value which has the closest repeat?

We could run for 2^33 iterations and keep a record in a many gigabyte array, but I imagine there's a better way.

Boosts OK!

@ColinTheMathmo

#math #maths #polynomials #lfsr #prng #pseudorandom

Another #pseudorandom weekly fluctuation in #credit score. I hate this game, especially when I might be applying for a #mortgage soon.
if round function is a #cryptographically secure #pseudorandom function, Ki as seed, then 3 rounds make block cipher a #pseudorandom #permutation PP ,4 rounds make it a "strong" PP ( remains pseudorandom even to an adversary who gets #oracle access to its inverse permutation)