Reputation: 107
Is it possible to decode base64 to image(or string) contains visually same base64, or reverse, so it's loops to recursion.
P.S. base64 actually it's not the goal, so if you know other funny ways with decoded = visually encoded, I will be very appreciate.
Upvotes: 0
Views: 197
Reputation: 107
Didn't found solution, but compromise for my needs: First: image to base64; Second: image to color ascII-art contain prev base64 string.
P.S. Of course it's fake, but it works exactly as close as I wanted, I think on some sort of simple images it can works very usefull.
Upvotes: 0
Reputation: 64740
Is it possible to decode base64 to image(or string) contains visually same base64, or reverse, so it's loops to recursion.
So you want a base64-encoding-quine (see quine). Restated, you'd like either:
An x
such that ascii(decode_base64(x)) == x
. This isn't possible because base64 is strictly larger than the value being encoded. So the result of decoding yields something smaller than the initial value.
An x
such that some_really_vague_image_decoding(decode_base64(x)) ~ x
. This probably isn't possible for any standard image encoding because the number of bits required to represent a pixel, and number of pixels required to represent a character, are far larger than the 6 bits provided by a single base64 character.
Upvotes: 1