title: Calculating CRC in awk
body: <p>Has anyone implemented the POSIX 1003.2 compiliant CRC algorithm (as output by <code>cksum</code>) in awk/gawk?   I'm needing to do a checksum on an <em>in memory string</em> (not the whole file) and shelling out to call <code>cksum</code> is slow and expensive.</p>
  
  <p>My overall need is to generate a numerical checksum that fits within 10 digits or less.   Other hash/CRC functions could work too, anyone have any thing handy?</p>
  
  <p>A Google search and a scan of <a href="http://awk.info" rel="nofollow">awk.info</a> turned up nothing interesting.</p>
  
  <p><hr/>
  <strong>EDIT:</strong><br>
  I ended up using the external cksum command, but caching the results into an awk associative array.   Performance was good enough and I didn't need to reinvent the wheel.</p>