28 #define MD5_HASH_LEN 32
39 const char *errstr = NULL;
47 (
errcode(ERRCODE_INTERNAL_ERROR),
48 errmsg(
"could not compute %s hash: %s",
"MD5",
64 const char *errstr = NULL;
69 (
errcode(ERRCODE_INTERNAL_ERROR),
70 errmsg(
"could not compute %s hash: %s",
"MD5",
83 const char *typestr = NULL;
119 elog(
ERROR,
"could not initialize %s context: %s", typestr,
122 elog(
ERROR,
"could not update %s context: %s", typestr,
126 elog(
ERROR,
"could not finalize %s context: %s", typestr,
int pg_cryptohash_update(pg_cryptohash_ctx *ctx, const uint8 *data, size_t len)
int pg_cryptohash_init(pg_cryptohash_ctx *ctx)
void pg_cryptohash_free(pg_cryptohash_ctx *ctx)
pg_cryptohash_ctx * pg_cryptohash_create(pg_cryptohash_type type)
int pg_cryptohash_final(pg_cryptohash_ctx *ctx, uint8 *dest, size_t len)
const char * pg_cryptohash_error(pg_cryptohash_ctx *ctx)
Datum md5_bytea(PG_FUNCTION_ARGS)
Datum sha384_bytea(PG_FUNCTION_ARGS)
Datum sha256_bytea(PG_FUNCTION_ARGS)
Datum sha512_bytea(PG_FUNCTION_ARGS)
Datum sha224_bytea(PG_FUNCTION_ARGS)
Datum md5_text(PG_FUNCTION_ARGS)
static bytea * cryptohash_internal(pg_cryptohash_type type, bytea *input)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define PG_GETARG_BYTEA_PP(n)
#define PG_GETARG_TEXT_PP(n)
#define PG_RETURN_BYTEA_P(x)
#define PG_RETURN_TEXT_P(x)
void * palloc0(Size size)
bool pg_md5_hash(const void *buff, size_t len, char *hexsum, const char **errstr)
#define PG_SHA256_DIGEST_LENGTH
#define PG_SHA384_DIGEST_LENGTH
#define PG_SHA512_DIGEST_LENGTH
#define PG_SHA224_DIGEST_LENGTH
#define SET_VARSIZE(PTR, len)
#define VARSIZE_ANY_EXHDR(PTR)
text * cstring_to_text(const char *s)