Y
Y
YakovSpb2021-09-10 17:15:53
SQL
YakovSpb, 2021-09-10 17:15:53

How do I add required characters to a random password?

await queryRunner.query(`CREATE OR REPLACE FUNCTION random_hex(int) RETURNS TEXT as $$
            SELECT string_agg(substring('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!#$%&()*+,-./:;<=>[email protected][]^', ceil(random() * 85)::integer, 1), '') FROM generate_series(1, $1);
        $$ language sql;`);

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question