1
0
mirror of synced 2025-11-06 03:20:55 +08:00
Files
SnowFlake-IdGenerator/C/source/idgen/IdGenOptions.c
2021-06-28 17:22:45 +08:00

35 lines
950 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* 版权属于yitter(yitter@126.com)
* 开源地址https://github.com/yitter/idgenerator
*/
#include "IdGenOptions.h"
extern IdGeneratorOptions BuildIdGenOptions(uint32_t workerId) {
IdGeneratorOptions options;
options.Method = 1;
options.BaseTime = 1582136402000;
options.WorkerId = workerId;
options.WorkerIdBitLength = 6;
options.SeqBitLength = 6;
options.MaxSeqNumber = 0;
options.MinSeqNumber = 5;
options.TopOverCostCount = 2000;
return options;
// IdGeneratorOptions *options = (IdGeneratorOptions *) malloc(sizeof(IdGeneratorOptions));
//
// options->Method = 1;
// options->BaseTime = 1582136402000;
// options->WorkerId = workerId;
// options->WorkerIdBitLength = 6;
// options->SeqBitLength = 6;
// options->MaxSeqNumber = 63;
// options->MinSeqNumber = 5;
// options->TopOverCostCount = 2000;
//
// return options;
}