|
Cryptix V3.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--cryptix.util.core.Hex
Static methods for converting to and from hexadecimal strings.
Copyright © 1995-1997
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.2 $
Method Summary | |
static String |
byteToString(int n)
Returns a string of 2 hexadecimal digits (most significant digit first) corresponding to the lowest 8 bits of n. |
static String |
dumpString(byte[] data)
|
static String |
dumpString(byte[] data,
int offset,
int length)
|
static String |
dumpString(byte[] data,
int offset,
int length,
String m)
Dump a byte array as a string, in a format that is easy to read for debugging. |
static String |
dumpString(byte[] data,
String m)
|
static String |
dumpString(int[] data)
|
static String |
dumpString(int[] data,
int offset,
int length)
|
static String |
dumpString(int[] data,
int offset,
int length,
String m)
Dump an int array as a string, in a format that is easy to read for debugging. |
static String |
dumpString(int[] data,
String m)
|
static int |
fromDigit(char ch)
Returns the number from 0 to 15 corresponding to the hex digit ch. |
static byte[] |
fromReversedString(String hex)
Returns a byte array from a string of hexadecimal digits in reverse order (i.e. |
static byte[] |
fromString(String hex)
Returns a byte array from a string of hexadecimal digits. |
static String |
intToString(int n)
Returns a string of 8 hexadecimal digits (most significant digit first) corresponding to the integer n, which is treated as unsigned. |
static String |
longToString(long n)
Returns a string of 16 hexadecimal digits (most significant digit first) corresponding to the long n, which is treated as unsigned. |
static void |
main(String[] args)
|
static void |
self_test(java.io.PrintWriter out)
|
static String |
shortToString(int n)
Returns a string of 4 hexadecimal digits (most significant digit first) corresponding to the lowest 16 bits of n. |
static char |
toDigit(int n)
Returns the hex digit corresponding to a number n, from 0 to 15. |
static String |
toReversedString(byte[] b)
|
static String |
toReversedString(byte[] b,
int offset,
int length)
Returns a string of hexadecimal digits in reverse order from a byte array (i.e. |
static String |
toString(byte[] ba)
|
static String |
toString(byte[] ba,
int offset,
int length)
Returns a string of hexadecimal digits from a byte array. |
static String |
toString(int[] ia)
|
static String |
toString(int[] ia,
int offset,
int length)
Returns a string of hexadecimal digits from an integer array. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Method Detail |
public static String toString(byte[] ba, int offset, int length)
If offset and length are omitted, the whole array is used.
public static String toString(byte[] ba)
public static String toString(int[] ia, int offset, int length)
If offset and length are omitted, the whole array is used.
public static String toString(int[] ia)
public static String toReversedString(byte[] b, int offset, int length)
If offset and length are omitted, the whole array is used.
public static String toReversedString(byte[] b)
public static byte[] fromString(String hex)
public static byte[] fromReversedString(String hex)
This is not really either little nor big-endian; it's just obscure. It is here because it is the format used for the SPEED certification data.
public static char toDigit(int n)
public static int fromDigit(char ch)
public static String byteToString(int n)
public static String shortToString(int n)
public static String intToString(int n)
public static String longToString(long n)
public static String dumpString(byte[] data, int offset, int length, String m)
If offset and length are omitted, the whole array is used. If m is omitted, nothing is prepended to each line.
data
- the byte array to be dumpedoffset
- the offset within data to start fromlength
- the number of bytes to dumpm
- a string to be prepended to each linepublic static String dumpString(byte[] data)
public static String dumpString(byte[] data, String m)
public static String dumpString(byte[] data, int offset, int length)
public static String dumpString(int[] data, int offset, int length, String m)
If offset and length are omitted, the whole array is used. If m is omitted, nothing is prepended to each line.
data
- The int[] to dumpoffset
- The offset within data to start fromlength
- The number of ints to dumpm
- A string to prepend to each linepublic static String dumpString(int[] data)
public static String dumpString(int[] data, String m)
public static String dumpString(int[] data, int offset, int length)
public static void main(String[] args)
public static void self_test(java.io.PrintWriter out)
|
Cryptix V3.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |