org.jboss.seam.security.crypto
public class BinTools extends Object
Free auxiliary functions. Copyright (c) 2007 Matthias Gärtner
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
For Details, see http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
Constructor and Description |
---|
BinTools() |
public static final String hex
public static String bin2hex(byte[] b)
b
- Input bytes. May be null
.null
input.public static byte[] hex2bin(String s)
s
- String containing hexadecimal digits. May be null
.
On odd length leading zero will be assumed.null
.IllegalArgumentException
- when string contains non-hex characterpublic static int hex2bin(char c)
c
- 0-9, a-f, A-F allowd.IllegalArgumentException
- on non-hex characterCopyright © 2015 Seam Framework. All Rights Reserved.