All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.webbitserver.helpers.Hex Maven / Gradle / Ivy

There is a newer version: 0.4.15
Show newest version
package org.webbitserver.helpers;

public class Hex {
    public static String toHex(byte[] bytes) {
        StringBuilder sb = new StringBuilder(bytes.length * 2);
        for (byte b : bytes) {
            int v = b & 0xff;
            if (v < 16) {
                sb.append('0');
            }
            sb.append(Integer.toHexString(v));
        }
        return sb.toString().toUpperCase();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy