Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document the underlying algorithm #4

Open
cipriancraciun opened this issue Jan 26, 2023 · 1 comment
Open

Document the underlying algorithm #4

cipriancraciun opened this issue Jan 26, 2023 · 1 comment

Comments

@cipriancraciun
Copy link

cipriancraciun commented Jan 26, 2023

Is there a document that specifies the algorithm behind LifeHash?

I know there are at least three reference implementations in various languages, listed below for completeness, however it requires a lot of effort to reverse engineer these:

For example I was looking for a pure Rust based implementation but there is none. I might have tried to implement one in a weekend, but there is no specification to start from, and reverse engineering an already implementation is far from a weekend project. :)

Also, for completeness, the video linked in the repository does give some insight, but it doesn't contain all the actual details: https://www.youtube.com/watch?v=cu0K__KLxKo

@cipriancraciun
Copy link
Author

I would like to expand a bit about the topic of documentation. I think there are two broad reasons for documenting LifeHash:

  • documenting the various primitives that are used:
    • like for example how to initialize the game-of-life, and how to run the simulation;
    • combining the multiple simulations into the final grid;
    • transformations on the final grid to obtain colors, and patterns;
  • fine-grained and very explicit documentation on how to exactly combine these primitives to obtain identical outputs; (i.e. to write exact implementations that yield identical output on the same input;)

Documenting the primitives would be useful to allow one to use LifeHash as an inspiration for other kinds of projects. (For example I'm currently interested in a LifeHash variant that is suitable for console output, for a similar purpose like OpenSSH's visual key fingerprint comparing.)

The second part, the explicit algorithm, is also important because looking at the Python implementation I see a lot of tweaking (like digesting the digest once more if one uses V2) and someone might easily pass over such details and then try to wonder why their output doesn't match the original one.


At the moment, at least for my own purposes I think I understood enough from the Python implementation to write something resembling the grayscale fiducial variant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant