Created
October 21, 2016 09:54
-
-
Save msm-code/7c2526ab7316ba77d230e8eeda2af433 to your computer and use it in GitHub Desktop.
paper.python.9791eab6a92fd95aff480029c993e429
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def parse_message(blob): | |
| i = 0 | |
| while i < len(blob): | |
| chunk_type = blob[i:i+4] | |
| chunk_len = from_uint32(blob[i+4:i+8]) | |
| chunk_content = blob[i+8:i+8+chunk_len] | |
| process_chunk(chunk_type, chunk_content) | |
| i += 8 + chunk_len |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment