Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
andai
20 days ago
|
parent
|
context
|
favorite
| on:
Simplest Hash Functions
Re: missing return keyword
Actually, in Python, None is a valid key...
(I'm so sorry. JavaScript has ruined me.)
tetha
20 days ago
|
next
[–]
Any `return c` for some constant is a valid and correct hash function. It just has a lot of collisions and degenerates hash-maps to terrible performance. That was in fact my first thought when I read "simplest hash functions".
eru
20 days ago
|
prev
[–]
That's why I said "probably".
Consider applying for YC's Summer 2026 batch! Applications are open till May 4
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
Actually, in Python, None is a valid key...
(I'm so sorry. JavaScript has ruined me.)