This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
stellar-stellar/src/snowflake/snowflake.h
2024-08-16 11:02:19 +08:00

24 lines
347 B
C

#pragma once
#ifdef __cplusplus
extern "C"
{
#endif
#include <stdint.h>
struct snowflake_options
{
uint8_t snowflake_base;
uint8_t snowflake_offset;
};
// return 0: success
// return -1: failed
int snowflake_id_init(const struct snowflake_options *opts);
uint64_t snowflake_id_generate(uint64_t now_sec);
#ifdef __cplusplus
}
#endif