4 ms·
How do you imagine this is done? Hashing the town state and storing lookup key as URL params?
by JayStavis 5y ago
How do you imagine this is done? Hashing the town state and storing lookup key as URL params?
- jwolfe 5y agoCouldn't it be as simple as a list of (color, x, y, z) (base64 encoded) in the fragment? URL fragments can get really long. Not sure what you'd need a look up key for.
- slingnow 5y agoYou have a fixed 3D grid, which appears to only need to store either a color or 'null' in every spot. You can encode this entire grid in any number of ways such that it creates a valid URL. Base64 most likely. https://en.wikipedia.org/wiki/Base64 https://en.wikipedia.org/wiki/Base64
- hoseja 5y agoThe URL is full of dashes and underscores, clearly not standard Base64.
- samwillis 5y agoI believe Oskar is bit packing the data into the string, somewhere in his twitter feed he explains it. Edit: Found it: https://twitter.com/OskSta/status/1198958801363308544 https://twitter.com/OskSta/status/1198958801363308544 He designed it so you can fit a saved town in a tweet. "It's my own very context specific implementation. I know how many bits I need for each bit of data, so I just store it all in a big bit array. I then convert that bit array to my own custom base 64 format, based on 64 web safe characters." Worth reading the whole thread, as will all of Oskars twitter feed its super interesting.
- IshKebab 5y agoNo need. It's barely any data.