签名工具 sign

码农软件 · 软件分类 · 其他开发相关 · 2019-10-23 06:56:55

软件介绍

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


本文地址:https://www.codercto.com/soft/d/17360.html

MATLAB智能算法30个案例分析

MATLAB智能算法30个案例分析

史峰、王辉、胡斐、郁磊 / 北京航空航天大学出版社 / 2011-7-1 / 39.00元

MATLAB智能算法30个案例分析,ISBN:9787512403512,作者:史峰,王辉 等编著一起来看看 《MATLAB智能算法30个案例分析》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具