当前位置: 首页>>代码示例>>Java>>正文


Java Hex.encodeToString方法代码示例

本文整理汇总了Java中org.apache.shiro.codec.Hex.encodeToString方法的典型用法代码示例。如果您正苦于以下问题:Java Hex.encodeToString方法的具体用法?Java Hex.encodeToString怎么用?Java Hex.encodeToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.shiro.codec.Hex的用法示例。


在下文中一共展示了Hex.encodeToString方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toHex

import org.apache.shiro.codec.Hex; //导入方法依赖的package包/类
@Override
public String toHex() {
	if ( this.cachedHex == null ) {
		this.cachedHex = Hex.encodeToString(getBytes());
	}
	return this.cachedHex;
}
 
开发者ID:TomChen001,项目名称:xmanager,代码行数:8,代码来源:ShiroByteSource.java

示例2: testHex

import org.apache.shiro.codec.Hex; //导入方法依赖的package包/类
@Test
public void testHex(){
    String str = "hello";
    String hexEncode = Hex.encodeToString(str.getBytes());
    String str2 = new String(Hex.decode(hexEncode.getBytes()));
    Assert.assertEquals(str, str2);
}
 
开发者ID:l81893521,项目名称:shiro-demo,代码行数:8,代码来源:CodecAndCryptoTest.java

示例3: toHex

import org.apache.shiro.codec.Hex; //导入方法依赖的package包/类
/**
 *
 * @return a hex-encoded string of the underlying {@link #getBytes byte array}.
 */
public String toHex() {
    if (this.hexEncoded == null) {
        this.hexEncoded = Hex.encodeToString(getBytes());
    }
    return this.hexEncoded;
}
 
开发者ID:nano-projects,项目名称:nano-framework,代码行数:11,代码来源:AbstractHash.java

示例4: toHex

import org.apache.shiro.codec.Hex; //导入方法依赖的package包/类
public String toHex() {
    if ( this.cachedHex == null ) {
        this.cachedHex = Hex.encodeToString(getBytes());
    }
    return this.cachedHex;
}
 
开发者ID:wjggwm,项目名称:webside,代码行数:7,代码来源:MyByteSource.java

示例5: toHex

import org.apache.shiro.codec.Hex; //导入方法依赖的package包/类
public String toHex() {
	if (this.cachedHex == null) {
		this.cachedHex = Hex.encodeToString(getBytes());
	}
	return this.cachedHex;
}
 
开发者ID:inexistence,项目名称:VideoMeeting,代码行数:7,代码来源:MySimpleByteSource.java

示例6: generateSecretKey

import org.apache.shiro.codec.Hex; //导入方法依赖的package包/类
private String generateSecretKey() {
  Key key = cipherService.generateNewKey();
  return Hex.encodeToString(key.getEncoded());
}
 
开发者ID:obiba,项目名称:agate,代码行数:5,代码来源:ConfigurationService.java

示例7: toHex

import org.apache.shiro.codec.Hex; //导入方法依赖的package包/类
/**
 * Returns a hex-encoded string of the underlying {@link #getBytes byte array}.
 * <p/>
 * This implementation caches the resulting hex string so multiple calls to this method remain efficient.
 * However, calling {@link #setBytes setBytes} will null the cached value, forcing it to be recalculated the
 * next time this method is called.
 *
 * @return a hex-encoded string of the underlying {@link #getBytes byte array}.
 */
public String toHex() {
    if (this.hexEncoded == null) {
        this.hexEncoded = Hex.encodeToString(getBytes());
    }
    return this.hexEncoded;
}
 
开发者ID:xuegongzi,项目名称:rabbitframework,代码行数:16,代码来源:AbstractHash.java

示例8: encrytHex

import org.apache.shiro.codec.Hex; //导入方法依赖的package包/类
/**
 * 16进制加密
 *
 * @param content
 * @return
 */
public static String encrytHex(String content) {
    Preconditions.checkArgument(!Strings.isNullOrEmpty(content), "不能为空");
    byte[] bytes = content.getBytes();
    return Hex.encodeToString(bytes);
}
 
开发者ID:melonlee,项目名称:LazyREST,代码行数:12,代码来源:EndecryptUtil.java

示例9: encrytHex

import org.apache.shiro.codec.Hex; //导入方法依赖的package包/类
/** 
 * 16进制加密 
 * 
 * @param password 
 * @return 
 */ 
public static String encrytHex(String password) { 
    byte[] bytes = password.getBytes(); 
    return Hex.encodeToString(bytes); 
}
 
开发者ID:wjggwm,项目名称:webside,代码行数:11,代码来源:EndecryptUtils.java


注:本文中的org.apache.shiro.codec.Hex.encodeToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。