title: How to calculate crc32 checksum from a string on linux bash
body: <p>I used crc32 to calculate checksums from strings a long time ago, but I cannot remember how I did it.</p>
  <pre><code>echo -n &quot;LongString&quot; | crc32    # no output
  </code></pre>
  <p>I found a solution [1] to calculate them with Python, but is there not a direct way to calculate that from a string?</p>
  <pre><code># signed
  python -c 'import binascii; print binascii.crc32(&quot;LongString&quot;)'
  python -c 'import zlib; print zlib.crc32(&quot;LongString&quot;)'
  # unsigned
  python -c 'import binascii; print binascii.crc32(&quot;LongString&quot;) % (1&lt;&lt;32)'
  python -c 'import zlib; print zlib.crc32(&quot;LongString&quot;) % (1&lt;&lt;32)'
  </code></pre>
  <p>[1] <a href="https://stackoverflow.com/questions/30092226/how-to-calculate-crc32-with-python-to-match-online-results">How to calculate CRC32 with Python to match online results?</a></p>