Last active
August 29, 2015 14:20
-
-
Save ianthrive/61017e604cf1bd07774c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION public.random_md5() RETURNS text LANGUAGE sql | |
AS $$ SELECT md5(gen_random_bytes(1024)); $$; | |
CREATE OR REPLACE FUNCTION public.sha256(subject bytea) RETURNS text LANGUAGE sql | |
AS $function$ SELECT ENCODE(DIGEST($1, 'sha256'), 'hex'); $function$ | |
CREATE OR REPLACE FUNCTION public.random_sha256() RETURNS text LANGUAGE sql | |
AS $$ SELECT sha256(gen_random_bytes(1024)); $$; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment