Files
2025-06-28 16:10:13 +08:00

27 lines
476 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.

#ifndef UTILS_H
#define UTILS_H
#include <stdbool.h>
/**
* 获取当前时间戳(毫秒)
* @return 时间戳
*/
long long get_timestamp();
/**
* 生成随机字符串
* @param buffer 输出缓冲区
* @param length 字符串长度
*/
void generate_random_string(char* buffer, int length);
/**
* 检查指针是否有效
* @param ptr 要检查的指针
* @return true表示有效false表示无效
*/
bool is_pointer_valid(const void* ptr);
#endif // UTILS_H