mtproto v0.1.0-alpha MTProto.Packet

Module for dealing with packets - encode, decode, ecnrypt, decrypt.

Summary

Functions

Tries to extract packet by it size, returns :more when packet is incomplete, otherwise :ok

Encodes packet as “bare”, without encryption and empty auth_key, used for authorizaion only

Functions

decode(packet_with_size)
decode(binary) :: {:more, pos_integer, binary} :: {:ok, binary, binary}

Tries to extract packet by it size, returns :more when packet is incomplete, otherwise :ok

decode_packet(packet_with_meta, state)
encode(request, state)
encode_bare(packet, message_id)
encode_bare(binary, non_neg_integer) :: binary

Encodes packet as “bare”, without encryption and empty auth_key, used for authorizaion only.

encode_packet_size(packet)
need_ack?(arg1)