Method: OmfCommon::Auth::SSHPubKeyConvert.unpack_string

Defined in:
lib/omf_common/auth/ssh_pub_key_convert.rb

.unpack_string(bytes, len) ⇒ Object

Unpack a string from the bytes array. Exactly len bytes will be extracted.

Returns a pair (string, bytes), where string is the extracted string (of length len), and bytes is the remainder of the original bytes array that follows string.



33
34
35
# File 'lib/omf_common/auth/ssh_pub_key_convert.rb', line 33

def self.unpack_string(bytes, len)
  return bytes.unpack("A#{len}")[0], bytes[len..-1]
end