Java tutorial
//package com.java2s; //License from project: Apache License import java.math.BigInteger; public class Main { static String bin2hex(byte[] data) { return String.format("%0" + (data.length * 2) + "X", new BigInteger(1, data)); } }