sha224() 是一个系统函数,用于计算提供二进制字符串的 SHA-224 哈希。
sha224() 函数已添加至 PostgreSQL 11。
示例
对 sha224() 的基本用法示例
postgres=# SELECT sha224('foo'::bytea);
sha224
------------------------------------------------------------
\x0808f64e60d58979fcb676c96ec938270dea42445aeefcd3a4e6f8db
(1 row)
将生成的哈希值作为 text 字符串返回
postgres=# SELECT encode(sha224('foo'::bytea), 'hex');
encode
----------------------------------------------------------
0808f64e60d58979fcb676c96ec938270dea42445aeefcd3a4e6f8db
(1 row)
参考资料
- PostgreSQL 文档: 其他二进制字符串函数
