All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.att.nsa.util.base64.rrcBase64Constants Maven / Gradle / Ivy

There is a newer version: 1.2.0-oss
Show newest version
/*******************************************************************************
 * Copyright (c) 2016 AT&T Intellectual Property. All rights reserved.
 *******************************************************************************/
/*
 *	This code was originally pulled from Apache licensed code from Rathravane LLC 
 */
package com.att.nsa.util.base64;

public class rrcBase64Constants
{
	public static final char kNewline = 10;

	public static char[] nibblesToB64 = new char [64];
	public static byte[] b64ToNibbles = new byte [128];

	static
	{
		int j = 0;
		for ( char c = 'A'; c <= 'Z'; c++ )
		{
			nibblesToB64[j++] = c;
		}
		for ( char c = 'a'; c <= 'z'; c++ )
		{
			nibblesToB64[j++] = c;
		}
		for ( char c = '0'; c <= '9'; c++ )
		{
			nibblesToB64[j++] = c;
		}
		nibblesToB64[j++] = '+';
		nibblesToB64[j++] = '/';

		for ( int i = 0; i < b64ToNibbles.length; i++ )
		{
			b64ToNibbles[i] = -1;
		}
		for ( int i = 0; i < 64; i++ )
		{
			b64ToNibbles[nibblesToB64[i]] = (byte) i;
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy