private double calcEntropy(byte[] b, int start, int len) {
		float sum = 0;

		long[] countArray = new long[256];

		for (int i = start; i < (start + len); i++) {
			countArray[(b[i]) & 0xff] += 1;
		}

		for (long count : countArray) {
			if (count == 0) {
				continue;
			}
			double p_x = (double) count / (double) len;
			sum -= p_x * Math.log(p_x) * 1.0 / Math.log(2);
		}

		return sum;
	}
@see ghidra.app.util.viewer.field.FieldFactory#getField(ProxyObj, int)
Ghidra/Extensions/sample/src/main/java/ghidra/examples/EntropyFieldFactory.java