badger/tests/packetgen.py
def read_lb_pack(fname):
    ''' Kind of special purpose
    lines of hex-encoded bytes, doesn't matter how many bytes per line
    multiple bytes per line are interpreted as big-endian (network byte order)
    '''
    d = b""
    with open(fname, "r") as fd:
        for line in fd.read().split("\n"):
            if line == "":
                continue
            ll = int(len(line)/2)
            xx = [int(line[ix*2:ix*2+2], 16) for ix in range(ll)]
            d += bytes(xx)
    return d
 Kind of special purpose
    lines of hex-encoded bytes, doesn't matter how many bytes per line
    multiple bytes per line are interpreted as big-endian (network byte order)
    
Kind of special purpose
lines of hex-encoded bytes, doesn't matter how many bytes per line
multiple bytes per line are interpreted as big-endian (network byte order)
Kind of special purpose lines of hex - encoded bytes doesn ' t matter how many bytes per line multiple bytes per line are interpreted as big - endian ( network byte order )
def read_lb_pack(fname):
    d = b""
    with open(fname, "r") as fd:
        for line in fd.read().split("\n"):
            if line == "":
                continue
            ll = int(len(line)/2)
            xx = [int(line[ix*2:ix*2+2], 16) for ix in range(ll)]
            d += bytes(xx)
    return d
def read_lb_pack ( fname ) : d = b"" with open ( fname , "r" ) as fd : for line in fd . read ( ) . split ( "\n" ) : if line == "" : continue ll = int ( len ( line ) / 2 ) xx = [ int ( line [ ix * 2 : ix * 2 + 2 ] , 16 ) for ix in range ( ll ) ] d += bytes ( xx ) return d
Kind of special purpose
lines of hex-encoded bytes, doesn't matter how many bytes per line
multiple bytes per line are interpreted as big-endian (network byte order)
Kind of special purpose lines of hex - encoded bytes doesn ' t matter how many bytes per line multiple bytes per line are interpreted as big - endian ( network byte order )
''' Kind of special purpose
    lines of hex-encoded bytes, doesn't matter how many bytes per line
    multiple bytes per line are interpreted as big-endian (network byte order)
    '''
fname