Base64

Base64 Encoding and Decoding - Base64

Introduction

Base64 encoding represents 256 (2 to the power of 8) ASCII characters using 64 (2 to the power of 6) ASCII characters. In other words, a group of three binary digits is encoded into four ASCII characters, increasing the length by approximately 1/3.

Usage

String a = "伦家是一个非常长的字符串";
//5Lym5a625piv5LiA5Liq6Z2e5bi46ZW/55qE5a2X56ym5Liy
String encode = Base64.encode(a);

// Restores to 'a'
String decodeStr = Base64.decodeStr(encode);