A method of hash visualization based on Conway’s Game of Life that creates beautiful icons that are deterministic, yet distinct and unique given the input data.
The basic concept is to take a SHA256 hash of the input data (which can be any data including another hash) and then use the 256-bit digest as a 16x16 pixel "seed" for running the cellular automata known as Conway’s Game of Life.
After the pattern becomes stable (or begins repeating) the resulting history is used to compile a grayscale image of all the states from the first to last generation. Using Game of Life provides visual structure to the resulting image, even though it was seeded with entropy.
Some bits of the initial hash are then used to deterministically apply symmetry and color to the icon to add beauty and quick recognizability.
Thanks for the link— hadn't heard of Smoothlife. Very cool. Of course the same technique could be adapted in some form.
One advantage of LifeHash using a small world-size is that the pattern inevitably becomes stable (repeats a state) after a reasonable number of iterations. I do have a hard-coded limit for the number of iterations, but it's just a backstop and large enough so I never see it hit in practice. A much larger, more complex simulation could go on for much longer, and since I really want to end up with a static icon, I want to limit the time and complexity of computing it.
Another advantage of using a small world size is that the initial 16x16 cell grid includes exactly 256 cells, which is the same number of bits in a SHA256 hash. Any hash, visual or otherwise, should be extremely sensitive to initial conditions, so a small change in input yields a massive change in output. Having the same number of cells as hash bits means every single bit counts with equal significance to the outcome.
7 comments
[ 3.7 ms ] story [ 26.0 ms ] threadThe basic concept is to take a SHA256 hash of the input data (which can be any data including another hash) and then use the 256-bit digest as a 16x16 pixel "seed" for running the cellular automata known as Conway’s Game of Life.
After the pattern becomes stable (or begins repeating) the resulting history is used to compile a grayscale image of all the states from the first to last generation. Using Game of Life provides visual structure to the resulting image, even though it was seeded with entropy.
Some bits of the initial hash are then used to deterministically apply symmetry and color to the icon to add beauty and quick recognizability.
Could one adapt it to smoothlife to get rid of the low-res look? https://www.youtube.com/watch?v=KJe9H6qS82I
One advantage of LifeHash using a small world-size is that the pattern inevitably becomes stable (repeats a state) after a reasonable number of iterations. I do have a hard-coded limit for the number of iterations, but it's just a backstop and large enough so I never see it hit in practice. A much larger, more complex simulation could go on for much longer, and since I really want to end up with a static icon, I want to limit the time and complexity of computing it.
Another advantage of using a small world size is that the initial 16x16 cell grid includes exactly 256 cells, which is the same number of bits in a SHA256 hash. Any hash, visual or otherwise, should be extremely sensitive to initial conditions, so a small change in input yields a massive change in output. Having the same number of cells as hash bits means every single bit counts with equal significance to the outcome.
I guess a good supersizing algo would be interesting.