Last active
August 26, 2017 20:11
-
-
Save salrashid123/b39e2ad383169290c9f64edfcb70f8d5 to your computer and use it in GitHub Desktop.
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 w(filename): | |
req = echo_pb2.EchoRequest(firstname='john', lastname='doe') | |
msg = binascii.b2a_hex(req.SerializeToString()) | |
frame = '00' + hex(len(msg)/2).lstrip("0x").zfill(8) + msg | |
print 'Raw Encode: ' + frame | |
f = open(filename, "wb+") | |
f.write(binascii.a2b_hex(frame)) | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment