How to calculate 32 bit CRC in Ruby on rails?

Jeyavel picture Jeyavel · Nov 25, 2010 · Viewed 11.2k times · Source

i want to calculate 32 bit CRC value for 'input field value" in Ruby on rails. need the sample code , please help me anyone.

Answer

rwilliams picture rwilliams · Nov 25, 2010

You could use Ruby's Zlib module.

require 'zlib'
crc32 = Zlib::crc32('input field value')