@SuppressWarnings("deprecation")
    public static String encodeHex(byte[] data) {
        int l = data.length;
        byte[] out = new byte[l << 1];

        for (int i = 0; i < l; i++) {
            byte b = data[i];

            int j = i << 1;
            out[j] = DIGITS_LOWER[((0xF0 & b) >>> 4)];
            out[j + 1] = DIGITS_LOWER[(0xF & b)];
        }
        return new String(out, 0, 0, out.length);
    }
@Test
    public void testEncodeHex() {
        assertEquals("", Hex.encodeHex(new byte[0]));
        assertEquals("00", Hex.encodeHex(new byte[1]));
        assertEquals("00000000", Hex.encodeHex(new byte[4]));
        assertEquals("10a3d1ff", Hex.encodeHex(new byte[]{0x10, (byte) 0xa3, (byte) 0xd1, (byte) 0xff}));
    }