Module: Ethon::Easies::Util
Overview
This module contains small helpers.
Instance Method Summary collapse
-
#escape_zero_byte(value) ⇒ String, Object
Escapes zero bytes in strings.
Instance Method Details
#escape_zero_byte(value) ⇒ String, Object
Escapes zero bytes in strings.
17 18 19 20 |
# File 'lib/ethon/easies/util.rb', line 17 def escape_zero_byte(value) return value unless value.to_s.include?(0.chr) value.to_s.gsub(0.chr, '\\\0') end |