Method: Wework::Cipher#unpack

Defined in:
lib/wework/cipher.rb

#unpack(msg) ⇒ Object



56
57
58
59
60
61
62
63
# File 'lib/wework/cipher.rb', line 56

def unpack(msg)
  msg = decode_padding(msg)
  msg_len = msg[16, 4].reverse.unpack('V')[0]
  content = msg[20, msg_len]
  app_id = msg[(20 + msg_len)..-1]

  [content, app_id]
end