Java Byte Array to Hex String bytesToHexChecksum(byte[] byteArr)

Here you can find the source of bytesToHexChecksum(byte[] byteArr)

Description

bytes To Hex Checksum

License

BSD License

Declaration

public static String bytesToHexChecksum(byte[] byteArr) 

Method Source Code

//package com.java2s;
/*/*from w ww. jav a 2  s. c o m*/
 * Copyright (C) 2010-2012, Wan Lee, wan5332@gmail.com
 * Source can be obtained from git://github.com/wanclee/datashaper.git
 * BSD-style license. Please read license.txt that comes with source files
 */

public class Main {
    public static String bytesToHexChecksum(byte[] byteArr) {
        StringBuilder buf = new StringBuilder();
        for (int i = 0; i < byteArr.length; i++) {
            buf.append(Integer.toHexString(0xFF & byteArr[i]).toUpperCase());
        }
        return buf.toString();
    }
}

Related

  1. bytes_to_hex(byte[] bytes)
  2. bytesToHexAppend(byte[] bs, int off, int length, StringBuffer sb)
  3. bytesToHexChars(byte[] bytes)
  4. bytesToHexChars(byte[] bytes)
  5. bytesToHexChars(byte[] bytes)
  6. bytesToHexDelimeter(byte[] data, String delimeter)
  7. bytesToHexFormatted(byte[] bytes)
  8. bytesToHexSpaced(byte[] bytes)
  9. bytesToHexStr(byte[] bcd)