sha384()

A function computing a SHA-384 hash

sha384() is a system function for computing the SHA-384 hash of the provided binary string.

sha384() was added in PostgreSQL 11.

Usage

sha384 ( bytea ) → bytea

Change history

Examples

Basic usage example for sha384():

postgres=# SELECT sha384('foo'::bytea);
                                               sha384                                               
----------------------------------------------------------------------------------------------------
 \x98c11ffdfdd540676b1a137cb1a22b2a70350c9a44171d6b1180c6be5cbb2ee3f79d532c8a1dd9ef2e8e08e752a3babb
(1 row)

Return the generated hash as a text string:

postgres=# SELECT encode(sha384('foo'::bytea), 'hex');
                                              encode                                              
--------------------------------------------------------------------------------------------------
 98c11ffdfdd540676b1a137cb1a22b2a70350c9a44171d6b1180c6be5cbb2ee3f79d532c8a1dd9ef2e8e08e752a3babb
(1 row)

Categories

System function

See also

sha224(), sha256(), sha512(), md5()