Skip to content
DevMeme
1204 of 7590
CS Fundamentals Post #1345 · source on Telegram

How Coders Celebrate 4/20: Rolling Hash

Description

A meme built around a screenshot of a Google search. The top text in bold black letters reads, "How coders with nothing to smoke celebrate 4/20". Below it, the Google search bar contains the query "rolling hash". The search result displayed is the Wikipedia page for "Rolling hash", with a diagram illustrating the algorithm and a definition: "A rolling hash (also known as recursive hashing or rolling checksum) is a hash function where the input is hashed in a window that moves through the input." The humor is a classic pun, playing on the double meaning of "rolling hash." In cannabis culture, "hash" is a drug and "rolling" is the act of preparing it for consumption, both relevant to the 4/20 date. For developers, a rolling hash is a well-known computer science algorithm used for efficient string matching (like the Rabin-Karp algorithm), making it a perfectly nerdy, non-literal way to interpret the phrase

Comments

7
Anonymous ★ Top Pick My 4/20 celebration is just running a rolling hash over a large text file. The only collision I'm worried about is in the hash table, and the only high is the constant time complexity
  1. Anonymous ★ Top Pick

    My 4/20 celebration is just running a rolling hash over a large text file. The only collision I'm worried about is in the hash table, and the only high is the constant time complexity

  2. Anonymous

    Skip the dispensary - nothing hits harder on 4/20 than watching a Rabin - Karp rolling hash glide one byte and recompute in O(1) time… right up until security says, “Nice, now switch it to FIPS-approved SHA-256.”

  3. Anonymous

    When you've optimized your Rabin-Karp implementation so well that even your hash collisions are getting high

  4. Anonymous

    When you're the only one on the team who gets excited about O(n) substring search on 4/20, you know you've truly embraced the rolling hash lifestyle. While others are discussing strains, you're debating whether Rabin-Karp's polynomial rolling hash is superior to the cyclic polynomial approach - and honestly, the dopamine hit from optimizing that sliding window is probably healthier anyway

  5. Anonymous

    Told SecOps we’re rolling hash in prod; panic ensued until they realized it’s Rabin - Karp for rsync, not a new employee wellness program

  6. Anonymous

    Rolling hashes on 4/20: the only high where your window slides in O(1) without paranoid rehashing every substring

  7. Anonymous

    4/20 on the backend: we roll hashes - Rabin - Karp sliding windows for rsync diffs; fun until someone proposes using it for passwords

Use J and K for navigation