Displaying 1 result from an estimated 1 matches for "hex_encod".
Did you mean:
hex_encode
2006 Mar 03
0
binary_to_string/string_to_binary confusion
...bin.data, ''Newly assigned data differs from original''
assert @data == bin.data, ''Data differs from original after save''
but the generated SQL is invalid because it attempts to insert raw
binary into the database.
If I implement them as follows:
def self.hex_encode(value)
retvalue = ""
value.each_byte do |b|
retvalue << sprintf("%02X", b)
end
retvalue
end
def self.hex_decode(value)
retvalue = ""
value.scan(/../) do |h|
c = h.hex
retv...