postgresql Postgres cryptographic functions digest

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

DIGEST() functions generate a binary hash of the given data. This can be used to create a random hash.

Usage: digest(data text, type text) returns bytea

Or: digest(data bytea, type text) returns bytea

Examples:

  • SELECT DIGEST('1', 'sha1')

  • SELECT DIGEST(CONCAT(CAST(current_timestamp AS TEXT), RANDOM()::TEXT), 'sha1')



Got any postgresql Question?