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

podświetlone jako asp (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;
}
 
| Blogi za darmo | | Wklejacz kodów | | Skracacz linków | | Best Toasters UK 2025 | | Best Freestanding Ovens UK 2025 | | Bamboo Socks UK | | Jewelry & Accessories UK | | UK Fashion Shop | | Hair Care Shop UK | | Jewellery Shop UK |