Problems solved in full
-
Getting to 68 characters from a 49-character ASCII JSON payload and back 5 steps
The input is
eyJuYW1lIjoiU3BvY2siLCJyb2xlIjoic2NpZW50aXN0IiwiYWN0aXZlIjp0cnVlfQ==, and the payload under it is the 49-character ASCII JSON{"name":"Spock","role":"scientist","active":true}. The panel prints 68 for Characters and 68 for Bytes. Get to 68 from the 49 without counting the encoded string โ then get back.-
Base64 is a change of base, not a cipher. 64 = 26, so each output character carries 6 bits; 3 input bytes carry 24; and 6 divides 24 exactly. That is the whole format: 3 bytes in, 4 characters out, no remainder.
-
49 bytes is 16 whole triples with 1 byte over. The triples are the easy part โ 16 ร 4 = 64 characters, every one of them carrying a full 6 bits.
-
The orphan byte is where padding comes from. 8 bits is not a multiple of 6, so it is topped up with 4 zero bits to make 12, which is 2 characters, and 2 '=' signs finish the quartet. 64 + 2 + 2 = 68. Each '=' marks a character position that had no bits of its own.
-
Both panel rows read 68, and that agreement says nothing about this string. The base64 alphabet is ASCII, so every character it emits is exactly 1 byte; the Bytes row would track the Characters row for any base64 input at all.
-
Now reverse it. 68 รท 4 = 17 quartets, 17 ร 3 = 51 byte slots, minus the 2 slots the padding admits are empty: 49. You have just recovered the payload's size without decoding a single byte of it.
Answer
68 characters for 49 bytes, and the '=' signs are what let you read the 49 straight back off the wrapper. That inversion is the useful half. A base64 string's length depends on its payload's length and on nothing else, so you can state the exact size of something you are not permitted to open โ which is a stronger statement than any detector on this page makes about content. The other half is the bill. 4 characters per 3 bytes never improves, so base64 costs 4/3 in the limit: a 1 MiB file arrives as 1,398,104 characters, 341 KiB of pure packaging. This string does worse, at 68/49 = 1.388, because the 2 padding characters are a fixed surcharge and 49 bytes is far too short to spread it thin.
-
-
Random bits in a GUID/UUID v4 and identifiers minted before a repeat 6 steps
The input is
550e8400-e29b-41d4-a716-446655440000, which the panel calls a GUID/UUID v4 while also offering to decode it as Base64URL. Work out how many of its bits were actually chosen at random, and how many such identifiers can be minted before a repeat stops being unlikely.-
Count the shape first: 8-4-4-4-12 hex digits with 4 hyphens between the groups, so 32 + 4 = 36 characters, and the Bytes row matches at 36 because hex digits and hyphens are all ASCII. Note what those 4 hyphens are worth. They sit at fixed positions, so they carry 0 bits.
-
Each hex digit is 4 bits, so the 32 that count hold 128. That is the number usually quoted for a UUID, and for this string it is too high.
-
Digit 13 and digit 17 are the reason. Digit 13 is 4, and it is the version field โ a version-4 UUID is obliged to put a 4 there, so those 4 bits were never a choice. Digit 17 is 'a', which is 1010 in binary, and its leading 2 bits are the variant tag, pinned at 10. 6 bits spent naming the format leaves 122.
-
The space is therefore 2122, about 5.32 ร 1036 โ not the 3.40 ร 1038 that 128 bits would have given.
-
Repeats follow the birthday rule rather than the size of the space. Drawing n identifiers at random, the chance that some pair matches grows like n2/(2N), and setting that to 0.5 gives n = 1.177โN. The count goes with the square root, which is why the 6 bits lost in step 3 cost a factor of 8 and not a factor of 64.
-
โN is 2.31 ร 1018, so n comes out at 2.7 ร 1018.
Answer
122 bits, and 2.7 ร 1018 UUIDs before the chance of any repeat reaches 0.5. Minted at 109 per second that is 86 years, and it is the whole argument for letting every machine generate its own with no registry and no coordination โ not a protocol, just a number too large to reach. Set it beside the first problem and the contrast is what this page is for. Base64 packs 6 bits into every character; this string spends 36 characters on 122 bits, which is 3.4 bits each, so the same identifier would fit in 21 base64url characters. The other 15 buy legibility, not information. And the Base64URL decode the panel offers comes back flagged as binary rather than text for the plainest reason available: nothing was ever encoded in there to find.
-
References (1)
- The alphabets and padding rules the detector reasons about, normatively: S. Josefsson, "The Base16, Base32, and Base64 Data Encodings." RFC 4648, IETF, 2006.