Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    /**
     *
     * @param data
     * @return
     */
    public static String toUnifyId(byte[] data) {
        if (data == null || data.length == 0) {
            return "";
        }

        StringBuilder result = new StringBuilder();

        for (byte b : data) {
            result.append(String.format("%02X", b));
        }

        return result.toString();
    }
}