本文整理匯總了Java中org.herac.tuxguitar.community.auth.utils.Base64Encoder類的典型用法代碼示例。如果您正苦於以下問題:Java Base64Encoder類的具體用法?Java Base64Encoder怎麽用?Java Base64Encoder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Base64Encoder類屬於org.herac.tuxguitar.community.auth.utils包,在下文中一共展示了Base64Encoder類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: update
import org.herac.tuxguitar.community.auth.utils.Base64Encoder; //導入依賴的package包/類
public void update(){
try {
String passwordMD5 = new String();
if( this.password != null && this.password.length() > 0 ){
MessageDigest md = MessageDigest.getInstance("md5");
md.update(this.password.getBytes());
byte[] digest = md.digest();
for (int i = 0; i < digest.length; i++){
passwordMD5 += Integer.toHexString((digest[i] >> 4) & 0xf);
passwordMD5 += Integer.toHexString((digest[i] & 0xf));
}
}
this.authCode = new String(Base64Encoder.encode( new String(this.username + ";" + passwordMD5 ).getBytes() ) );
} catch (Throwable throwable) {
throwable.printStackTrace();
}
}
示例2: save
import org.herac.tuxguitar.community.auth.utils.Base64Encoder; //導入依賴的package包/類
public void save( TGConfigManager config ){
String data = new String(this.getUsername() + STRING_SEPARATOR + this.getPassword() );
String encodedData = new String(Base64Encoder.encode( data.getBytes() ) ) ;
config.setValue("community.account", encodedData );
}
示例3: save
import org.herac.tuxguitar.community.auth.utils.Base64Encoder; //導入依賴的package包/類
public void save( TGConfigManager config ){
String data = new String(this.getUsername() + STRING_SEPARATOR + this.getPassword() );
String encodedData = new String(Base64Encoder.encode( data.getBytes() ) ) ;
config.setProperty("community.account", encodedData );
}