mirror of
https://github.com/postgres/postgres.git
synced 2025-10-28 11:55:03 +03:00
Attached are two small patches to expose md5 as a user function -- including
documentation and regression test mods. It seemed small and unobtrusive enough to not require a specific proposal on the hackers list -- but if not, let me know and I'll make a pitch. Otherwise, if there are no objections please apply. Joe Conway
This commit is contained in:
@@ -313,3 +313,21 @@ select split_part('@joeuser@mydatabase@','@',2) AS "joeuser";
|
||||
select to_hex(256*256*256 - 1) AS "ffffff";
|
||||
|
||||
select to_hex(256::bigint*256::bigint*256::bigint*256::bigint - 1) AS "ffffffff";
|
||||
|
||||
--
|
||||
-- MD5 test suite - from IETF RFC 1321
|
||||
-- (see: ftp://ftp.rfc-editor.org/in-notes/rfc1321.txt)
|
||||
--
|
||||
select md5('') = 'd41d8cd98f00b204e9800998ecf8427e' AS "TRUE";
|
||||
|
||||
select md5('a') = '0cc175b9c0f1b6a831c399e269772661' AS "TRUE";
|
||||
|
||||
select md5('abc') = '900150983cd24fb0d6963f7d28e17f72' AS "TRUE";
|
||||
|
||||
select md5('message digest') = 'f96b697d7cb7938d525a2f31aaf161d0' AS "TRUE";
|
||||
|
||||
select md5('abcdefghijklmnopqrstuvwxyz') = 'c3fcd3d76192e4007dfb496cca67e13b' AS "TRUE";
|
||||
|
||||
select md5('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') = 'd174ab98d277d9f5a5611c2c9f419d9f' AS "TRUE";
|
||||
|
||||
select md5('12345678901234567890123456789012345678901234567890123456789012345678901234567890') = '57edf4a22be3c955ac49da2e2107b67a' AS "TRUE";
|
||||
|
||||
Reference in New Issue
Block a user