Convert PHP code into Ruby!
RSS icon Email icon Home icon
  • crc32

    Posted on September 17th, 2009 RubyLove 1 comment

    The crc32() function in PHP generates the cyclic redundancy checksum (CRC) polynomial of 32-bit lengths of a string, and returns it as an integer.

    PHP

    $checksum = crc32('hello world');
    echo $checksum;
    // => 222957957

    Ruby

    require 'zlib';
    puts Zlib.crc32('hello world');
    # => 222957957