com.lambdaworks.codec
Class Base16

java.lang.Object
  extended by com.lambdaworks.codec.Base16

public class Base16
extends Object

High-performance base16 (AKA hex) codec.

Author:
Will Glozer

Constructor Summary
Base16()
           
 
Method Summary
static byte[] decode(char[] src)
          Decode base16 chars to bytes.
static char[] encode(byte[] src, boolean upper)
          Encode bytes to base16 chars.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Base16

public Base16()
Method Detail

encode

public static char[] encode(byte[] src,
                            boolean upper)
Encode bytes to base16 chars.

Parameters:
src - Bytes to encode.
upper - Use upper or lowercase chars.
Returns:
Encoded chars.

decode

public static byte[] decode(char[] src)
Decode base16 chars to bytes.

Parameters:
src - Chars to decode.
Returns:
Decoded bytes.


Copyright © 2013. All Rights Reserved.