def pad_hex ( value , bit_size ) : value = remove_0x_prefix ( value ) return add_0x_prefix ( value . zfill ( int ( bit_size / 4 ) ) )
python pad with leading zeros in bitstrings
Pads a hex string up to the given bit_size
def pad_hex(value, bit_size):
    """
    Pads a hex string up to the given bit_size
    """
    value = remove_0x_prefix(value)
    return add_0x_prefix(value.zfill(int(bit_size / 4)))