DevOps研发效能
媒体矩阵
开源中国APP
授权协议 GPL
开发语言 C/C++ 查看源码 »
操作系统 Windows
软件类型 开源软件
开源组织
地区 国产
投 递 者 不详
适用人群 未知
收录时间 2014-01-04

软件简介

sign 签名工具,给出任意一个字符串,可以生成基本不会重合的2个32位无符号的数字。如果自己是数字,那么就直接赋值给低位。检索用的可能比较多。

1 API

int create_sign64(const char* input, unsigned int* sign1, unsigned int* sign2);

input 是输入 sign1 是返回的高位 sign2 是返回的低位

2 代码范例

#include "sign.h"
#include <iostream>
using namespace std;

int main()
{
    unsigned int a, b;
    char s1[] = "-12345";
    char s2[] = "hello, 中国";
    create_sign64(s1, &a, &b);
    cout << a << "\t" << (int)b << endl;

    create_sign64(s2, &a, &b);
    cout << (int)a << "\t" << b << endl;
}

3 运行结果

liujuntekiMacBook-Pro:sample liujun$ ./sample 
0   -12345
2013960652  3228893707
展开阅读全文

代码

的 Gitee 指数为
超过 的项目

评论

点击引领话题📣 发布并加入讨论🔥
暂无内容
发表了博客
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
发表了问答
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
暂无内容
0 评论
3 收藏
分享
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部