The pgcrypto module provides cryptographic functions for PostgreSQL.
F.25.1. General Hashing Functions F.25.1.1. digest()
digest(data text, type text) returns bytea
digest(data bytea, type text) returns bytea
Computes a binary hash of the given data. type is the algorithm to use. Standard algorithms are md5, sha1, sha224, sha256, sha384 and sha512. If pgcrypto was built with OpenSSL, more algorithms are available, as detailed in Table F-20. If you want the digest as a hexadecimal string, u