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


Java DigestUtils.shaHex方法代码示例

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


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

示例1: girisButonuTiklandi

import org.apache.commons.codec.digest.DigestUtils; //导入方法依赖的package包/类
@FXML
private void girisButonuTiklandi(ActionEvent event) throws IOException
{
	String username=kullaniciAdi.getText();
	String password=DigestUtils.shaHex(sifreText.getText());
	
	if(username.equals(secimler.getKullaniciadi()) && password.equals(secimler.getPassword()))
	{
		closeStage();
		loadMain();
	}
	else
	{
		Alert alert1=new Alert(Alert.AlertType.ERROR);
		alert1.setTitle("Giri� Yap�lamad�");
		alert1.setHeaderText(null);
		alert1.setContentText("Kullan�c� ad� veya �ifre hatal�");
		alert1.showAndWait();
	}
	
}
 
开发者ID:mevlanayalcin,项目名称:KutuphaneOtomasyonSistemi,代码行数:22,代码来源:Controller.java

示例2: getJoinMeetingURL

import org.apache.commons.codec.digest.DigestUtils; //导入方法依赖的package包/类
@Override
   public String getJoinMeetingURL(UserDTO userDTO, String meetingKey, String password) throws Exception {

// Get Bbb details
String serverURL = getConfigValue(Constants.CFG_SERVER_URL);
String securitySalt = getConfigValue(Constants.CFG_SECURITYSALT);
// Get Join parameter
String joinParam = Constants.BBB_JOIN_PARAM;

if (serverURL == null) {
    BbbService.logger.error("Config item : '" + Constants.CFG_SERVER_URL + "' not defined");
    throw new BbbException("Server url not defined");
}

String queryString = "fullName="
	+ URLEncoder.encode(userDTO.getFirstName() + " " + userDTO.getLastName(), "UTF8") + "&meetingID="
	+ URLEncoder.encode(meetingKey, "UTF8") + "&password=" + URLEncoder.encode(password, "UTF8");

String checkSum = DigestUtils.shaHex("join" + queryString + securitySalt);

String url = serverURL + joinParam + queryString + "&checksum=" + checkSum;

return url;
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:25,代码来源:BbbService.java

示例3: poll

import org.apache.commons.codec.digest.DigestUtils; //导入方法依赖的package包/类
@Override
public synchronized Request poll(String spiderName) {

    Jedis jedis = pool.getResource();
    try {
        String url = jedis.lpop(getQueueKey(spiderName));
        if (url == null) {
            return null;
        }

        String key = ITEM_PREFIX + url;
        String field = DigestUtils.shaHex(url);
        byte[] bytes = jedis.hget(key.getBytes(), field.getBytes());
        if (bytes != null) {
            Request o = JSON.parseObject(new String(bytes), Request.class);
            return o;
        }

        Request request = new Request(url);
        return request;
    } finally {
        pool.returnResource(jedis);
    }
}
 
开发者ID:fengzhizi715,项目名称:NetDiscovery,代码行数:25,代码来源:RedisQueue.java

示例4: setPassword

import org.apache.commons.codec.digest.DigestUtils; //导入方法依赖的package包/类
public void setPassword(String password) {
	if(password.length()<16)
	{
	this.password =DigestUtils.shaHex(password);
	}
	else
	{
		this.password =password;
	}
}
 
开发者ID:mevlanayalcin,项目名称:KutuphaneOtomasyonSistemi,代码行数:11,代码来源:Secimler.java

示例5: cleanupTileCache

import org.apache.commons.codec.digest.DigestUtils; //导入方法依赖的package包/类
public void cleanupTileCache() {
  final String hstr = DigestUtils.shaHex(
    metadata.getName() + "_" + metadata.getVersion()
  );

  final File tdir = new File(Info.getConfDir(), "tiles/" + hstr);
  if (tdir.exists()) {
    try {
      FileUtils.forceDelete(tdir);
    }
    catch (IOException e) {
      WriteErrorDialog.error(e, tdir);
    }
  }
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:16,代码来源:ModuleManagerWindow.java

示例6: getImageTileSource

import org.apache.commons.codec.digest.DigestUtils; //导入方法依赖的package包/类
public ImageTileSource getImageTileSource() {
  if (tcache == null) {
    // FIXME: There's no guarantee that getGameName() and getGameVersion()
    // are properly set at this point.

    final String hstr =
      DigestUtils.shaHex(getGameName() + "_" + getGameVersion());

    final File tc = new File(Info.getConfDir(), "tiles/" + hstr);
    tcache = new ImageTileDiskCache(tc.getAbsolutePath());
  }

  return tcache;
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:15,代码来源:GameModule.java

示例7: generateConfigSignature

import org.apache.commons.codec.digest.DigestUtils; //导入方法依赖的package包/类
/**
 * 生成 config接口 signature
 * @param noncestr noncestr
 * @param jsapi_ticket jsapi_ticket
 * @param timestamp timestamp
 * @param url url
 * @return sign
 */
public static String generateConfigSignature(String noncestr,String jsapi_ticket,String timestamp,String url){
	Map<String, String> map = new HashMap<String, String>();
	map.put("noncestr", noncestr);
	map.put("jsapi_ticket", jsapi_ticket);
	map.put("timestamp", timestamp);
	map.put("url", url);
	
	Map<String, String> tmap = MapUtil.order(map);
	String str = MapUtil.mapJoin(tmap,true,false);
	return DigestUtils.shaHex(str);
}
 
开发者ID:luotuo,项目名称:springboot-security-wechat,代码行数:20,代码来源:JsUtil.java

示例8: getMeetingKey

import org.apache.commons.codec.digest.DigestUtils; //导入方法依赖的package包/类
public static String getMeetingKey(Long toolSessionId, String attendeePassword) {

	/*
	 * We hash the attendee's password to be used as part of the meetingKey.
	 * The main reason for this is so we can keep this unique in case there are many
	 * other instances that use the same BBB server
	 */
	return "bbb_" + DigestUtils.shaHex(attendeePassword) + "-" + toolSessionId;
    }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:BbbUtil.java

示例9: pushWhenNoDuplicate

import org.apache.commons.codec.digest.DigestUtils; //导入方法依赖的package包/类
@Override
protected void pushWhenNoDuplicate(Request request) {

    Jedis jedis = pool.getResource();
    try {
        jedis.rpush(getQueueKey(request.getSpiderName()), request.getUrl());
        String field = DigestUtils.shaHex(request.getUrl());
        String value = JSON.toJSONString(request);
        jedis.hset((ITEM_PREFIX + request.getUrl()), field, value);
    } finally {
        jedis.close();
    }

}
 
开发者ID:fengzhizi715,项目名称:NetDiscovery,代码行数:15,代码来源:RedisQueue.java

示例10: apacheApiVariations

import org.apache.commons.codec.digest.DigestUtils; //导入方法依赖的package包/类
public static void apacheApiVariations() {

        printHex(DigestUtils.getMd2Digest().digest("123".getBytes()));
        printHex(DigestUtils.getMd5Digest().digest("123".getBytes()));
        printHex(DigestUtils.getDigest("md2").digest("123".getBytes()));
        printHex(DigestUtils.getDigest("md5").digest("123".getBytes()));
        DigestUtils.md2("123".getBytes());
        DigestUtils.md5("123".getBytes());
        System.out.println(DigestUtils.md2Hex("123".getBytes()));
        System.out.println(DigestUtils.md5Hex("123".getBytes()));

        printHex(DigestUtils.getSha1Digest().digest("123".getBytes()));
        printHex(DigestUtils.getShaDigest().digest("123".getBytes()));
        printHex(DigestUtils.getDigest("sha1").digest("123".getBytes()));
        printHex(DigestUtils.getDigest("sha-1").digest("123".getBytes()));
        DigestUtils.sha1("123".getBytes());
        DigestUtils.sha("123".getBytes());
        DigestUtils.sha1Hex("123".getBytes());
        DigestUtils.shaHex("123".getBytes());

        printHex(DigestUtils.getDigest("sha256").digest("123".getBytes())); //OK!
        printHex(DigestUtils.getDigest(getDigest()).digest("123".getBytes())); //Unknown
    }
 
开发者ID:blackarbiter,项目名称:Android_Code_Arbiter,代码行数:24,代码来源:WeakMessageDigest.java

示例11: encrypt

import org.apache.commons.codec.digest.DigestUtils; //导入方法依赖的package包/类
public String encrypt( String rawTxt ) {
	if( rawTxt==null ) {
		return null;
	}
	return DigestUtils.shaHex( rawTxt );
}
 
开发者ID:yswang0927,项目名称:ralasafe,代码行数:7,代码来源:ShaEncrypt.java

示例12: tileName

import org.apache.commons.codec.digest.DigestUtils; //导入方法依赖的package包/类
/**
 * Gets the name of a tile file.
 *
 * @param iname the image name
 * @param tileX the X coordinate of the tile
 * @param tileY the Y coordinate of the tile
 * @param div the scale divisor
 * @return the name of the tile file
 */
public static String tileName(String iname, int tileX, int tileY, int div) {
  final String sha = DigestUtils.shaHex(
    iname + "(" + tileX + "," + tileY + "@1:" + div
  );

  return sha.substring(0, 1) + '/' + sha.substring(0, 2) + '/' + sha;
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:17,代码来源:TileUtils.java

示例13: generateEventMessageSignature

import org.apache.commons.codec.digest.DigestUtils; //导入方法依赖的package包/类
/**
 * 生成事件消息接收签名
 * @param token token
 * @param timestamp timestamp
 * @param nonce nonce
 * @return str
 */
public static String generateEventMessageSignature(String token, String timestamp,String nonce) {
	String[] array = new String[]{token,timestamp,nonce};
	Arrays.sort(array);
	String s = StringUtils.arrayToDelimitedString(array, "");
	return DigestUtils.shaHex(s);
}
 
开发者ID:luotuo,项目名称:springboot-security-wechat,代码行数:14,代码来源:SignatureUtil.java


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