public static function getUniqid($hash = 'sha256', $prefix = '', $entropy = 10000, $rawOutput = false) {
            $str = mt_rand(~PHP_INT_MAX, PHP_INT_MAX) . json_encode([$_COOKIE,
                                                                     $_REQUEST,
                                                                     $_FILES,
                                                                     $_ENV,
                                                                     $_GET,
                                                                     $_POST,
                                                                     $_SERVER]) . uniqid($prefix, true) .
                   self::asciiRand($entropy, self::ASCII_ALL);

            if (function_exists('\openssl_random_pseudo_bytes')) {
                $algoStrong = null;
                $str .= \openssl_random_pseudo_bytes($entropy, $algoStrong);

                if ($algoStrong !== true) {
                    trigger_error('Please update your openssl & PHP libraries. openssl_random_pseudo_bytes was unable' .
                                  ' to locate a cryptographically strong algorithm.',
                                  E_USER_WARNING);
                }
            } else {
                trigger_error('The openssl extension is not enabled, therefore the unique ID is not ' .
                              'cryptographically secure.',
                              E_USER_WARNING);
            }

            return hash($hash, $str, $rawOutput);
        }