Live data from Hacker News

Simplest Hash Functions

purplesyringa.moe

61–62 of 62 posts

Re: Simplest Hash Functions

#61
post #58

Earlier quoted context omitted.

with a password you may be mapping into a smaller space or a bigger space, because what you want is to get them all same length, but yeah you may in some cases be mapping into a smaller space, hadn't thought of that, although I sort of also think it is unlikely. But there it doesn't matter anyway because the password is put together with the email to identify the user so in practicality passwords will never collide e…

For passwords: the input _space_ is bigger. That doesn't say anything about the length of any particular password. > But there it doesn't matter anyway because the password is put together with the email to identify the user so in practicality passwords will never collide even if they could in theory. For passowrds, you are not worried so much about two users accidentally getting the same hash, you are worried about…

>For passowrds, you are not worried so much about two users accidentally getting the same hash

right I was thinking I've probably personally never had a situation where a collision would have affected anything, but then I thought of one, when I had to do image hashing it was a potential problem.

Re: Simplest Hash Functions

#62
post #59
post #54

Earlier quoted context omitted.

Haskell and the Lisps also work like this.

Yes, I know, it's the natural way to do it in functional programming. Honestly I doubt there are any FP languages that don't do it like that.

I like that Rust, just like Lisp and Haskell et al also allow any block to return a value, not just functions. So if-then-else and loops etc can do that. It be nice if Python could do that.

Perhaps I should hack up Python to allow that. Would be an interesting little project.

Post reply on HN