Kashub's Code Barn - "PHP generate safe password"

podświetlone jako html4strict (dodał(a) csb @ 2019-06-13 18:12:28)

Podświetl ten kod w:
Ostatnio dodane:
Losowe wpisy:
<?php
function generatePassword($prefix = null) {
    $length = 48;
    $string = '';
    if (null !== $prefix) {
        $string .= preg_replace('/[^a-zA-Z]/', '', $prefix);
        $string .= bin2hex(openssl_random_pseudo_bytes($length - strlen($string)));
    } else {
        $string .= bin2hex(openssl_random_pseudo_bytes($length));
    }
    return $string;
}
 
| Bio Słodycze | | Sklep z oponami | | Skracacz linków | | Darmowe Blogi | | Best Toasters UK 2025 | | Best Fully Automatic Coffee Machines UK 2025 | | Best slow juicers UK | | Bamboo Socks UK | | UK Water Sports Shop | | VAN Tyres UK |