BEGIN; CREATE EXTENSION IF NOT EXISTS anon CASCADE; NOTICE: installing required extension "pgcrypto" SELECT anon.init(); init ------ t (1 row) -- hex_to_int SELECT anon.hex_to_int(NULL) IS NULL; ?column? ---------- t (1 row) SELECT anon.hex_to_int('000000') = 0; ?column? ---------- t (1 row) SELECT anon.hex_to_int('123456') = 1193046; ?column? ---------- t (1 row) SELECT anon.hex_to_int('ffffff') = 16777215; ?column? ---------- t (1 row) -- projection_to_oid SELECT anon.projection_to_oid(NULL::TIMESTAMP,NULL,NULL) IS NULL; ?column? ---------- t (1 row) SELECT anon.projection_to_oid('abcdefgh'::TEXT,'', 10000) = 9096; ?column? ---------- t (1 row) SELECT anon.projection_to_oid('xxxxxxxx'::VARCHAR(10),'yyyyy', 10000) = 9784; ?column? ---------- t (1 row) SELECT anon.projection_to_oid(42,'',10000); projection_to_oid ------------------- 6321 (1 row) SELECT anon.projection_to_oid('{}'::JSONB,'',10000); projection_to_oid ------------------- 5999 (1 row) SELECT anon.projection_to_oid('2020-03-24'::DATE,'',10000); projection_to_oid ------------------- 7993 (1 row) -- First Name SELECT anon.pseudo_first_name(NULL::JSONB) IS NULL; ?column? ---------- t (1 row) SELECT anon.pseudo_first_name('bob'::TEXT) = anon.pseudo_first_name('bob'::VARCHAR); ?column? ---------- t (1 row) SELECT anon.pseudo_first_name('bob'::TEXT,'123salt*!') = anon.pseudo_first_name('bob'::VARCHAR,'123salt*!'); ?column? ---------- t (1 row) SELECT anon.pseudo_first_name('42'::TEXT) = anon.pseudo_first_name(42); ?column? ---------- t (1 row) SELECT pg_typeof(anon.pseudo_first_name(NULL::UUID)) = 'TEXT'::REGTYPE; ?column? ---------- t (1 row) -- Last Name SELECT anon.pseudo_last_name(NULL::INT) IS NULL; ?column? ---------- t (1 row) SELECT anon.pseudo_last_name('bob'::TEXT,'x') = anon.pseudo_last_name('bob'::TEXT,'x'); ?column? ---------- t (1 row) -- Email SELECT anon.pseudo_email(NULL::INT) IS NULL; ?column? ---------- t (1 row) SELECT anon.pseudo_email('bob'::TEXT,'x') = anon.pseudo_email('bob'::TEXT,'x'); ?column? ---------- t (1 row) -- City SELECT anon.pseudo_city(NULL::INT) IS NULL; ?column? ---------- t (1 row) SELECT anon.pseudo_city('bob'::TEXT,'x') = anon.pseudo_city('bob'::TEXT,'x'); ?column? ---------- t (1 row) -- Country SELECT anon.pseudo_country(NULL::CHAR) IS NULL; ?column? ---------- t (1 row) SELECT anon.pseudo_country('bob'::TEXT,'x') = anon.pseudo_country('bob'::TEXT,'x'); ?column? ---------- t (1 row) -- Company SELECT anon.pseudo_company(NULL::POINT) IS NULL; ?column? ---------- t (1 row) SELECT anon.pseudo_company('bob'::TEXT,'x') = anon.pseudo_company('bob'::TEXT,'x'); ?column? ---------- t (1 row) -- IBAN SELECT anon.pseudo_iban(NULL::XML) IS NULL; ?column? ---------- t (1 row) SELECT anon.pseudo_iban('bob'::TEXT,'x') = anon.pseudo_iban('bob'::TEXT,'x'); ?column? ---------- t (1 row) -- Use a predefined secret salt SET anon.salt TO 'a_VeRy_SeCReT_SaLT'; SELECT anon.pseudo_last_name('bob'::TEXT); pseudo_last_name ------------------ Schumm (1 row) ROLLBACK;