They could just as easily have felt the underlying reason was so obvious it wasn’t worth mentioning.
I know how base64 encoding works but had never noticed the pattern the author pointed out. As soon as read it, I ubderstood why. It didn’t occur to me that the author should have explained it at a deeper level.
was incredulous but gave it a go, and it worked!!
Even if you don't notice the ey specifically the string itself just screams base64 encoding, regardless of what's actually inside.One blog post is hardly enough to just someone as ignorant but after quick look at the author's writing/coding/job history, I doubt he is that either.
I think it's fantastic that you can look at a string and feel it's base64 essence come through without a decoder. Thinking about it for a minute, I suspect I could train myself to do the same. If someone who already knew how to do it well wrote a how-to, I bet it would hit the front page and inspire many people, just like this article did.
I just don't get the urge to dump on the original author for sharing a new-to-him insight.
I've been doing this a long time but until today the only one I'd noticed was "MII".
> I did a few tests in my terminal, and he was right!
He clearly had no clue how base64 worked. You don’t need a test, if you know it.
> As pointed out by gnabgib and athorax on Hacker News, this actually detects the leading dashes of the PEM format
They needed help for this. I’m not sure that they opened Wikipedia at last to understand how base64 works even now. The whole article has an “it’s magic!” vibe.
https://web.cs.ucdavis.edu/~rogaway/classes/188/materials/th...
Both the author (in my opinion evidently) not understanding what base64 does and the short story is about depending on technology but not knowing/caring how it works underneath. If you can live with that, well go ahead. I find it not very hackerly.
You mention "being hackerly". Imagine you were reverse engineering some gnarly 100 MB obfuscated x86 binary. Surely you can appreciate that especially if you have a specific goal, it is overwhelmingly preferable to guess, experiment, and poke than to kick off some heroic RE effort that will take tens of people years, just so that you can supposedly "fully understand" what's happening. Attention is precious - not everything is worth equal attention. And it is absolutely possible to correctly guess things from limited information, and is even essential to be able to.
You find base64 encoding interesting enough that you were able to either recall detailed facts about its operation from memory here, or looked it up quickly to break it down. How is the author, or me, not doing so is any evidence for you we're:
- ignorant about how base64 works and always have been
- don't care about (CS) things at depth in general
These are such immensely strong claims to make. Surely you can appreciate that some people just have different interests sometimes? That they might focus on different things? That they can learn things and then forget about them? That to some level everything is connected, so appealing to that is not exactly some grand revelation of missing a "key piece"?
Few years, or I guess more than just a few years ago, in college, I met up with a former classmate from primary school. He was studying history and shared some great (historical) stories that I really enjoyed. But then another thought formulated in my mind: if I had to actively study this, rather than just catch a story or two, I'd definitely be dropping out. And that's when I realized that there can be value to things, they can be interesting, yet at the same time it's OK for me not to be interested by them or pursue them deeper. Just like how I think it is perfectly OK to be interested in this pattern, but not care for the underlying mapping mechanism, as it is essentially irrelevant. The fun was in the fact, not in the mechanism (in my view for the author anyways).
{" is ASCII 01111011, 00100010
Base64 takes 3 bytes x 8 bits = 24 bits, groups that 24 bit-sequence into four parts of 6 bits each, and then converts each to a number between 0-63. If there aren't enough bits (we only have 2 bytes = 16 bits, we need 18 bits), pad them with 0. Of course in reality the last 2 bits would be taken from the 3rd character of the JSON string, which is variable.
The first 6 bits are 011110, which in decimal is 30.
The second 6 bits are 110010, which in decimal is 50.
The last 4 bits are 0010. Pad it with 00 and you get 001000, which is 8.
Using an encoding table (https://base64.guru/learn/base64-characters), 30 is e, 50 is y and 8 is I. There's your "ey".
Funny how CS people are so incurious now, this blog post touches the surface but didn't get into the explanation.