java.lang.Object
i2p.susi.util.HexTable
Hex table utilities for byte-to-string conversion.
Field Summary
Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionstatic StringgetHexString(int b) Get hex string for the given byte value.static String[]getTable()Get a copy of the hex table for safe access.static StringgetTableEntry(int index) Direct access to table entry for backward compatibility.private static StringintToHex(int b) Convert an integer to its hexadecimal string representation.
Field Details
table
Three character strings, upper case, e.g. "=0A" WARNING: This array is public for backward compatibility but should be treated as immutable.
Constructor Details
HexTable
public HexTable()Constructor. The lookup table is built once in the static initializer, so an instance holds nothing.
Method Details
getHexString
Get hex string for the given byte value.- Parameters:
b- byte value (0-255)- Returns:
- hex string, e.g. "=0A"
getTableEntry
Direct access to table entry for backward compatibility.- Parameters:
index- a byte value between 0 and 255- Returns:
- hex string at that index
getTable
Get a copy of the hex table for safe access.- Returns:
- a copy of the hex table array
intToHex
Convert an integer to its hexadecimal string representation.- Parameters:
b- the value (0-255)- Returns:
- the hex string without leading zeros