本文整理汇总了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 );
}