Method: Wework::Cipher#unpack

Defined in:
lib/wework/cipher.rb

#unpack(msg) ⇒ Object



48
49
50
51
52
53
54
55
# File 'lib/wework/cipher.rb', line 48

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