bytes_to_int and int_to_bytes optimization