From d9d3857ee0433f343599e40da19bbaa2fe7cb5df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20W=C3=B6ber?= Date: Mon, 4 Jan 2010 22:40:37 +0100 Subject: [PATCH] Using String#unpack instead of String#bytes to work with Ruby < 1.8.7 --- lib/compass/grid_builder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compass/grid_builder.rb b/lib/compass/grid_builder.rb index af025b26..600516a7 100644 --- a/lib/compass/grid_builder.rb +++ b/lib/compass/grid_builder.rb @@ -15,7 +15,7 @@ module Compass class << self def crc(chunkdata='') - chunkdata.bytes.to_a.inject(0xffffffff){|crc, byte| CRC_TABLE[(crc ^ byte) & 0xff] ^ (crc >> 8) } ^ 0xffffffff + chunkdata.unpack('C*').to_a.inject(0xffffffff){|crc, byte| CRC_TABLE[(crc ^ byte) & 0xff] ^ (crc >> 8) } ^ 0xffffffff end def chunk(type, data="")