From: Gordon Thiesfeld Date: 2007-10-24T00:21:36+09:00 Subject: Re: How to search for ascii char sequence in binary file > So... best way to do the conversion, and best way to do the search. > Ideas? > > Earle Here's a way to do the conversion. No ideas on the search. class String def to_hex_string r = '' self.each_byte{|c| r << c.to_s(16)} r end end # unit test require 'test/unit' class TestString < Test::Unit::TestCase def test_convert assert_equal( '52494646', 'RIFF'.to_hex_string) end end Regards, Gordon