30 static const char *
hex =
"0123456789abcdef";
34 for (q = 0, w = 0; q < 16; q++)
36 s[w++] =
hex[(
b[q] >> 4) & 0x0F];
37 s[w++] =
hex[
b[q] & 0x0F];
const char * pg_cryptohash_error(pg_cryptohash_ctx *ctx)
int pg_cryptohash_update(pg_cryptohash_ctx *ctx, const uint8 *data, size_t len)
pg_cryptohash_ctx * pg_cryptohash_create(pg_cryptohash_type type)
int pg_cryptohash_init(pg_cryptohash_ctx *ctx)
void pg_cryptohash_free(pg_cryptohash_ctx *ctx)
int pg_cryptohash_final(pg_cryptohash_ctx *ctx, uint8 *dest, size_t len)
#define MD5_DIGEST_LENGTH
bool pg_md5_binary(const void *buff, size_t len, uint8 *outbuf, const char **errstr)
bool pg_md5_encrypt(const char *passwd, const uint8 *salt, size_t salt_len, char *buf, const char **errstr)
bool pg_md5_hash(const void *buff, size_t len, char *hexsum, const char **errstr)
static void bytesToHex(uint8 b[16], char *s)
static char buf[DEFAULT_XLOG_SEG_SIZE]