Returns a hex representation of the specified value. @param value value @param length length of hex output @return hex representation
(final int value, final int length)
| 1435 | * @return hex representation |
| 1436 | */ |
| 1437 | public static byte[] hex(final int value, final int length) { |
| 1438 | final byte[] tmp = new byte[length]; |
| 1439 | for(int l = 0; l < length; l++) { |
| 1440 | tmp[length - l - 1] = HEX_TABLE[value >> (l << 2) & 0xF]; |
| 1441 | } |
| 1442 | return tmp; |
| 1443 | } |
| 1444 | |
| 1445 | /** |
| 1446 | * Returns a hex representation of the specified byte array. |
no test coverage detected