Live data from Hacker News

Show HN: SHA-256 Animation

github.com

81–90 of 105 posts

Re: Show HN: SHA-256 Animation

#81
post #70
post #64

Earlier quoted context omitted.

The claim is not that every output has a unique input, which would not be correct, and seems to be what you are addressing.

at 1:08 in the video, that is exactly what he claims: "So every piece of data in the world has its own unique hash digest." This is false for the reasons apeescape describes: every piece of data in the world has its own hash digest, but these hash digests are not unique.

Yes that sentence is technically incorrect, but practically correct. We've never found a collision and though we expect it to be theoretically possible, even common if you consider "all possible inputs" and the pigeonhole principle, for practical purposes hash outputs are unique because nobody considers "all possible inputs" when evaluating probabilities.

I'm saying that for a layman explanation, it's reasonable to say that hash outputs are unique. Because following that with "technically, it's more 'practically' unique, theoretically there are collisions but you won't encounter them with probability > 2^-256" (or whatever it is) just confuses the topic to them more than just summarizing. You have to admit that most people won't go on a 200h adventure to learn about the state space of 256+ bits and how to conceptualize tiny statistical probabilities, so there must be a point where you have to cut the explanation to an approximation of the truth. This is true in every field.

Re: Show HN: SHA-256 Animation

#82

Earlier quoted context omitted.

Without any doubt I do not properly understand anything I can't explain to someone else. An exercise I go through constantly is figuring out how to explain a thing I think I know to a curious person with no relevant training. Often in the process I discover I need to go do more research or actually test things because I did not understand them as well as I'd maybe thought. Mostly this is just an exercise. But every s…

I realize it's not what you're saying, but I don't like the idea that if you can't teach something to others, you don't understand it yourself. Teaching is a skill and it's something that I am aware that I struggle with. I can explain something in great detail to a captive audience and understand it myself personally, but teaching is about getting others to engage with the ideas you're presenting and identifying and…

If you can't teach it, then you don't understand something perfectly. Perfect is a word par excellence. Teaching is indeed a skill but don't confuse it with presenting. A wise guy once said, "if you can’t explain something in simple terms, you don’t understand it". I'm sure OP stands by it and that itself is very admirable.

Re: Show HN: SHA-256 Animation

#83
post #73

Earlier quoted context omitted.

You guys really need to chill out. If you've got something to say, then say it.

I think you're being down-voted because your comment doesn't really add anything to the discussion at hand.

Oh, to this site punishes people for adding a positive remark. Great... I'll keep that in mind then. Anyway, thanks for letting me know!

Re: Show HN: SHA-256 Animation

#84
post #70

Earlier quoted context omitted.

at 1:08 in the video, that is exactly what he claims: "So every piece of data in the world has its own unique hash digest." This is false for the reasons apeescape describes: every piece of data in the world has its own hash digest, but these hash digests are not unique.

Yes that sentence is technically incorrect, but practically correct. We've never found a collision and though we expect it to be theoretically possible, even common if you consider "all possible inputs" and the pigeonhole principle, for practical purposes hash outputs are unique because nobody considers "all possible inputs" when evaluating probabilities. I'm saying that for a layman explanation, it's reasonable to s…

I don't like to leave holes like this in people's comprehension. It's OK if people don't end up with an intuitive feeling for how relatively unlikely different things that don't actually happen are, but I want them to be aware of that category as distinct from things which can't happen because the type of argument needed is different.

The air molecules in the room you're in can't all gather in one corner because that's not possible, it's forbidden by conservation rules.

But they won't gather in two opposite corners only because that's so tremendously unlikely, it would be allowed by conservation but statistically it's ludicrous.

The same is true at the opposite end of the spectrum. Almost all real numbers are normal (in all bases) but the nature of "Almost all" in mathematics is different in an important way from "All" and I want people to grasp this difference when I'm discussing properties of numbers. It definitely is not true that all real numbers are normal, you probably rarely think about any normal numbers at all.

Re: Show HN: SHA-256 Animation

#85
Love the animations but they go by too fast. It would be nice if you could add a single step capability so the user could follow along at human pace.

Also, I wanted to see how you updated the bit strings in place and was surprised not to find anything special. It looks like you use nothing but puts statements, which, as I understand it, simply add a carriage return at the end of a string but how then does the cursor move back up to the first line? Can some explain the technique being used here?

Re: Show HN: SHA-256 Animation

#86

Earlier quoted context omitted.

Yes that sentence is technically incorrect, but practically correct. We've never found a collision and though we expect it to be theoretically possible, even common if you consider "all possible inputs" and the pigeonhole principle, for practical purposes hash outputs are unique because nobody considers "all possible inputs" when evaluating probabilities. I'm saying that for a layman explanation, it's reasonable to s…

I don't like to leave holes like this in people's comprehension. It's OK if people don't end up with an intuitive feeling for how relatively unlikely different things that don't actually happen are, but I want them to be aware of that category as distinct from things which can't happen because the type of argument needed is different. The air molecules in the room you're in can't all gather in one corner because that…

> I don't like to leave holes like this in people's comprehension.

I agree. I think this wording would be better than in my previous comment, what do you think?

    it's reasonable to say that hash outputs are *almost surely* unique

Re: Show HN: SHA-256 Animation

#87

Love the animations but they go by too fast. It would be nice if you could add a single step capability so the user could follow along at human pace. Also, I wanted to see how you updated the bit strings in place and was surprised not to find anything special. It looks like you use nothing but puts statements, which, as I understand it, simply add a carriage return at the end of a string but how then does the cursor…

If you add the third optional argument of "enter" when running the sha256.rb script you can use your keyboard to step through. I haven't set this up for the individual animations though.

ruby sha256.rb sizzzzlerz enter

I didn't do anything special for the terminal animation. I just work out the current state of the hash function at each step, clear the terminal, and print the entire state back to the screen. I know it looks like I'm directly manipulating each individual bit in your terminal, but really I'm just redrawing your screen.

I'd like to do something more practical in future, but for this I just did what I needed to do to get an animation working. Still, every bit you are seeing is correct.

Re: Show HN: SHA-256 Animation

#88
post #83

Earlier quoted context omitted.

I think you're being down-voted because your comment doesn't really add anything to the discussion at hand.

Oh, to this site punishes people for adding a positive remark. Great... I'll keep that in mind then. Anyway, thanks for letting me know!

Just being positive and nothing else is what the upvote button is for. And turning your comment slightly gray is not really a punishment.

Re: Show HN: SHA-256 Animation

#89
post #70

Earlier quoted context omitted.

at 1:08 in the video, that is exactly what he claims: "So every piece of data in the world has its own unique hash digest." This is false for the reasons apeescape describes: every piece of data in the world has its own hash digest, but these hash digests are not unique.

Yes that sentence is technically incorrect, but practically correct. We've never found a collision and though we expect it to be theoretically possible, even common if you consider "all possible inputs" and the pigeonhole principle, for practical purposes hash outputs are unique because nobody considers "all possible inputs" when evaluating probabilities. I'm saying that for a layman explanation, it's reasonable to s…

Kind of agree w you, but still feel adding a few words by way of a disclaimer about collisions is much better than presenting as plain truth something that merely approaches it.

Re: Show HN: SHA-256 Animation

#90

I once heard about a meeting where someone did a presentation for the best part of an hour to a room full of Japanese people. They all nodded along, smiling as the presentation progressed. It wasn’t until the end that the presenter asked them what they thought. They all just kept smiling, but no answer. Someone at the front turned and talked to the room (in Japanese) then turned to the presented and said “they do not…

> “they do not speak any English, but they are sure from this presentation that you are very, very intelligent”

I kind of hope there's some nuance to this story and it didn't quite happened in the way you described.

If they think it's "polite" to let a person talk for an hour without understanding a word of it (while nodding and smiling), and then have the nerve to call it "intelligent", that's an insult to both the presentor and the concept of intelligence.

Cultural differences notwithstanding, the idea of "completely wasting someone's time while pretending to pay attention" shouldn't be too difficult to empathise with.

Post reply on HN