Ruby
Ruby
Example: Crypt2.CrcBd method
Demonstrates how to call the CrcBd method.Chilkat Ruby Downloads
require 'chilkat'
crypt = Chilkat::CkCrypt2.new()
bd = Chilkat::CkBinData.new()
bd.AppendString("123456789","us-ascii")
crc32 = crypt.CrcBd("crc-32",bd)
# The decimal value is 3421780262 (converted to hex is 0xCBF43926)
print crc32.to_s() + "\n";
crc8 = crypt.CrcBd("crc8",bd)
print crc8.to_s() + "\n";