Method: Fuzzer.encode

Defined in:
lib/vcseif/utils/fuzzer.rb

.encode(string) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/vcseif/utils/fuzzer.rb', line 15

def self.encode(string)
  return string if string.class.name != 'String'
  return string if string.empty?
  encoded = ""
  Base64.encode64(string).each_byte { |b|
    if ( b != 10 ) # \n
      encoded = encoded + b.chr + SEPARATOR
    end 
  }
  return ENCODED + encoded
end