chapter2
Class Utils

java.lang.Object
  extended by chapter2.Utils
Direct Known Subclasses:
Utils

public class Utils
extends java.lang.Object

General utilities for the second chapter examples.


Constructor Summary
Utils()
           
 
Method Summary
static java.lang.String toHex(byte[] data)
          Return the passed in byte array as a hex string.
static java.lang.String toHex(byte[] data, int length)
          Return length many bytes of the passed in byte array as a hex string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

toHex

public static java.lang.String toHex(byte[] data,
                                     int length)
Return length many bytes of the passed in byte array as a hex string.

Parameters:
data - the bytes to be converted.
length - the number of bytes in the data block to be converted.
Returns:
a hex representation of length bytes of data.

toHex

public static java.lang.String toHex(byte[] data)
Return the passed in byte array as a hex string.

Parameters:
data - the bytes to be converted.
Returns:
a hex representation of data.


Examples from "Beginning Cryptography with Java"