Every time you choose to apply a rule(s), explicitly state the rule(s) in the output. You can abbreviate the rule description to a single word or phrase.
[Brief description ]
- [more description]
- [more description]
- [more description]
| import java.security.SecureRandom; | |
| import javax.crypto.spec.PBEKeySpec; | |
| import javax.crypto.SecretKeyFactory; | |
| import java.math.BigInteger; | |
| import java.security.NoSuchAlgorithmException; | |
| import java.security.spec.InvalidKeySpecException; | |
| /* | |
| * PBKDF2 salted password hashing. | |
| * Author: havoc AT defuse.ca |
| package com.company; | |
| import javax.crypto.Cipher; | |
| import javax.crypto.Mac; | |
| import javax.crypto.spec.IvParameterSpec; | |
| import javax.crypto.spec.SecretKeySpec; | |
| import java.security.MessageDigest; | |
| import java.security.SecureRandom; | |
| public class Main { |
| CREATE EXTENSION IF NOT EXISTS pgcrypto; | |
| CREATE OR REPLACE FUNCTION generate_ulid() RETURNS uuid | |
| AS $$ | |
| SELECT (lpad(to_hex(floor(extract(epoch FROM clock_timestamp()) * 1000)::bigint), 12, '0') || encode(gen_random_bytes(10), 'hex'))::uuid; | |
| $$ LANGUAGE SQL; |
| /** | |
| * Returns a time-ordered UUID (v6). | |
| * | |
| * Tags: uuid guid uuid-generator guid-generator generator time order rfc4122 rfc-4122 | |
| */ | |
| create or replace function fn_uuid_time_ordered() returns uuid as $$ | |
| declare | |
| v_time timestamp with time zone:= null; | |
| v_secs bigint := null; |