Welcome To Ke_scholar's B|

Ke_scholar

园龄:2年1个月粉丝:30关注:10

unordered_map随机底数种子

偷的

struct myhash {
static uint64_t fxn(uint64_t x) {
x += 0x9e3779b97f4a7c15;
x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
return x ^ (x >> 31);
}
size_t operator ()(uint64_t x) const {
static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
return fxn(x + FIXED_RANDOM);
}
};

本文作者:Ke_scholar

本文链接:https://www.cnblogs.com/Kescholar/p/18449726

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   Ke_scholar  阅读(12)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起