全部版块 我的主页
论坛 数据科学与人工智能 IT基础 Linux操作系统
812 0
2023-05-22

Tech-Finger能稳定运行就是因为它的造血能力,也是它和别的圈子 最大的区别!!!

使用了FNV1_32_HASH算法,如下:

  public class HashUtil{

  /**关于区块链技术开发唯:Congge420

  *计算Hash值,使用FNV1_32_HASH算法

  *param str

  *return

  */关于区块链技术开发唯:Congge420

  public static int getHash(String str){

  final int p=16777619;

  int hash=(int)2166136261L;

  for(int i=0;i<str.length();i++){

  hash=(hash^str.charAt(i))*p;

  }

  hash+=hash<<13;

  hash^=hash>>7;

  hash+=hash<<3;

  hash^=hash>>17;

  hash+=hash<<5;

  if(hash<0){

  hash=Math.abs(hash);

  }

  return hash;

  }

  }


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群