def unpack(str)
      str.bytes.reverse.reduce(0) { |s, c| s * 256 + c }
    end
def unpack(str)
      str.bytes.reverse.reduce(0) { |s, c| s * 256 + c }
    end
Unpack a string into an integer.
 Little endian is used.

 @param [String] str
   String.

 @return [Integer]
   Result.

 @example
   Util.unpack("\xff")
   #=> 255
   Util.unpack("@\xE2\x01\x00")
   #=> 123456