public static Bytes bytesToPath(final Bytes bytes) {
    final MutableBytes path = MutableBytes.create(bytes.size() * 2 + 1);
    int j = 0;
    for (int i = 0; i < bytes.size(); i += 1, j += 2) {
      final byte b = bytes.get(i);
      path.set(j, (byte) ((b >>> 4) & 0x0f));
      path.set(j + 1, (byte) (b & 0x0f));
    }
    path.set(j, LEAF_TERMINATOR);
    return path;
  }
Converts a byte sequence into a path by splitting each byte into two nibbles. The resulting
path is terminated with a leaf terminator.

@param bytes the byte sequence to convert into a path
@return the resulting path
ethereum/trie/src/main/java/org/hyperledger/besu/ethereum/trie/CompactEncoding.java