38#define BCRYPT_HASH_MAXSIZE 65
40extern unsigned char st_app_terminate;
42unsigned char st_file_exists(
const char *fp);
43void st_hook_signals(
void);
44void st_hook_critical_signals(
void);
45char st_try_fork(
void);
46char st_set_ug_id(
int uid,
int gid);
47char st_setpidfile(
char *pidfile_path);
48void st_delpidfile(
char *pidfile_path);
49void st_mainloop_init();
50void st_mainloop_wait(
int usec);
51void st_mainloop_free();
53void st_guid2hex(
char GUIDHEX[SUPLA_GUID_HEXSIZE],
54 const char GUID[SUPLA_GUID_SIZE]);
55void st_authkey2hex(
char AuthKeyHEX[SUPLA_AUTHKEY_HEXSIZE],
56 const char AuthKey[SUPLA_AUTHKEY_SIZE]);
58char *st_str2hex(
char *buffer,
const char *str,
size_t maxlen);
59char *st_bin2hex(
char *buffer,
const char *src,
size_t len);
61char st_read_randkey_from_file(
char *file,
char *KEY,
int size,
char create);
62char st_read_guid_from_file(
char *file,
char *GUID,
char create);
63char st_read_authkey_from_file(
char *file,
char *AuthKey,
char create);
65time_t st_get_utc_time(
void);
67char *st_get_zulu_time(
char buffer[64]);
68char *st_get_datetime_str(
char buffer[64]);
72int st_hue2rgb(
double hue);
74void st_random_alpha_string(
char *buffer,
int buffer_size);
75void st_uuid_v4(
char buffer[37]);
79char st_bcrypt_gensalt(
char *salt,
int salt_buffer_size,
char rounds);
80char st_bcrypt_hash(
const char *str,
const char *salt,
char *hash,
81 int hash_buffer_size);
82char st_bcrypt_crypt(
char *str,
char *hash,
int hash_buffer_size,
char rounds);
83char st_bcrypt_check(
const char *str,
char *hash,
int hash_len);
84char *st_get_authkey_hash_hex(
const char AuthKey[SUPLA_AUTHKEY_SIZE]);
88unsigned _supla_int_t st_crc32_checksum(
const unsigned char *data,
92char *st_openssl_base64_encode(
const char *src,
int src_len);
93char *st_openssl_base64_decode(
const char *src,
int src_len,
int *dst_len);