def _pack_leaf_record(key, value):
    """Pack a key-value pair to go into a leaf node as a record"""
    if len(value) & 1:
        value += b'\x00'
    b = bytes([len(key) + 1, 0, *key])
    if len(b) & 1:
        b += bytes(1)
    b += value
    return b
