XOR random number generator to encrypt and decrypt a tree

0
Remix
  1. Implement a pseudo-random number generator whose state update uses bitwise XOR (shifts and XORs on an integer state), seeded so the same seed always gives the same sequence.
  2. Use it to encrypt a tree-structured document, walking the tree in a fixed order and mixing each value with the next generated number, and write the decryption that turns the result back into the original document. Explain why the same seed and the same traversal order make decryption work.
BasetenCodingLast asked Aug 2026
No answer yet. Write the first one; the best answer gets endorsed.