<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>C++ on random thoughts</title><link>https://riad.run/tags/c++/</link><description>Recent content in C++ on random thoughts</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Mon, 22 Apr 2019 00:00:00 +0000</lastBuildDate><atom:link href="https://riad.run/tags/c++/feed.xml" rel="self" type="application/rss+xml"/><item><title>String Hashing in C++</title><link>https://riad.run/posts/string-hashing-in-cpp/</link><pubDate>Mon, 22 Apr 2019 00:00:00 +0000</pubDate><guid>https://riad.run/posts/string-hashing-in-cpp/</guid><description>&lt;h2 id="what-is-hashing"&gt;What is Hashing?&lt;a class="heading-anchor" href="#what-is-hashing" aria-label="Link to this section"&gt;#&lt;/a&gt;&#10;&lt;/h2&gt;&lt;p&gt;Let&amp;rsquo;s think about a function &lt;code&gt;unsigned int hash(string)&lt;/code&gt;. This function will take a string as a parameter and return a unique ID let&amp;rsquo;s say an unsigned integer. This is called a hash function. It&amp;rsquo;ll generate a unique ID for every unique string. And same unique ID over and over for same string. Things get complicated when the two different strings generate same ID. This is called a hash collision.&lt;/p&gt;</description></item></channel></rss>