2001-10-01 16:12:23 +00:00
|
|
|
--
|
|
|
|
-- init pgcrypto
|
|
|
|
--
|
|
|
|
|
2011-02-13 20:06:41 -05:00
|
|
|
CREATE EXTENSION pgcrypto;
|
2001-10-01 16:12:23 +00:00
|
|
|
|
2009-08-04 18:49:50 +00:00
|
|
|
-- ensure consistent test output regardless of the default bytea format
|
|
|
|
SET bytea_output TO escape;
|
|
|
|
|
2001-10-01 16:12:23 +00:00
|
|
|
-- check for encoding fn's
|
2002-10-18 18:41:22 +00:00
|
|
|
SELECT encode('foo', 'hex');
|
|
|
|
SELECT decode('666f6f', 'hex');
|
2001-10-01 16:12:23 +00:00
|
|
|
|
2005-03-21 05:24:52 +00:00
|
|
|
-- check error handling
|
|
|
|
select gen_salt('foo');
|
|
|
|
select digest('foo', 'foo');
|
|
|
|
select hmac('foo', 'foo', 'foo');
|
|
|
|
select encrypt('foo', 'foo', 'foo');
|