Guava BaseEncoding - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Guava BaseEncoding class.

This code example shows how to use the following methods:encode
This code example shows how to use the following methods:decode
	public static byte[] decryptBytes(@Nonnull final String textToDecode, @Nonnull final char[] password) throws IOException
	{ 
		final byte[] decodeTextAsBytes;
		try 
		{ 
			decodeTextAsBytes = BASE64_DECRYPT.decode(textToDecode);
		} 
		catch (final IllegalArgumentException x)
		{ 
			throw new IOException("invalid base64 encoding");
		} 
 
		if (decodeTextAsBytes.length < OPENSSL_SALTED_BYTES.length)
			throw new IOException("out of salt");
 
		final byte[] cipherBytes = new byte[decodeTextAsBytes.length - OPENSSL_SALTED_BYTES.length];
		System.arraycopy(decodeTextAsBytes, OPENSSL_SALTED_BYTES.length, cipherBytes, 0, decodeTextAsBytes.length - OPENSSL_SALTED_BYTES.length);
 
		final byte[] decryptedBytes = decryptRaw(cipherBytes, password);
 
3
CodeRank
See Code Examples for Guava BaseEncoding Methods: