public static String format(byte[] checksum, boolean hex) {
		if (checksum == null || checksum.length == 0) {
			return "";
		}
		if (!hex && checksum.length <= Long.BYTES) {
			ByteBuffer buffy = ByteBuffer.allocate(Long.BYTES);
			buffy.put(new byte[Long.BYTES - checksum.length]);
			buffy.put(checksum);
			buffy.rewind();
			return Long.toUnsignedString(buffy.getLong());
		}

		return NumericUtilities.convertBytesToString(checksum);
	}
Formats the checksum as a string.

@param checksum The checksum to format as a string.
@param hex True if the checksum should be formatted as hex; false if decimal. 
           Note: if formatting as decimal is not possible, hex will be used instead.
@return The formatted checksum.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/checksums/ChecksumAlgorithm.java