public static String toHex(byte[] bytes) {
        byte[] encoded = new byte[bytes.length * 2];
        for (int i = 0; i < bytes.length; i++) {
            encoded[i * 2] = toHex((bytes[i] >> 4) & 0xF);
            encoded[i * 2 + 1] = toHex(bytes[i] & 0xF);
        }
        return new String(encoded, StandardCharsets.US_ASCII);
    }
Returns a String where each byte b in `bytes` is replaced by "%02x".formatted(b).
vespajlib/src/main/java/com/yahoo/text/StringUtilities.java