 <p>You can store the values in MySQL as <code>INT UNSIGNED</code> which occupies 4 bytes (i.e. 32 bits).</p> <p>To insert the values into the database, you must use <code>sprintf()</code> with <code>%u</code> format on 32 bit machines:</p> <pre><code>$hash = crc32("The quick brown fox jumped over the lazy dog."); $stmt = $db-&gt;prepare('INSERT INTO mytable VALUES (:hash)'); $stmt-&gt;execute(array( ':hash' =&gt; sprintf('%u', $hash), )); </code></pre> <p><strong>Update</strong></p> <p>You could also make sure that you're always working with int32 types (signed long) on both 32 and 64-bit platforms. Currently, you can only accomplish this by using <a href="http://php.net/pack" rel="nofollow"><code>pack()</code></a> and <a href="http://php.net/unpack" rel="nofollow"><code>unpack()</code></a>:</p> <pre><code>echo current(unpack('l', pack('l', $hash))); // returns -2103228862 on both 32-bit and 64-bit platforms </code></pre> <p>The idea for this was contributed by <a href="http://stackoverflow.com/users/283851/mindplay-dk">mindplay.dk</a></p>