model/SLSUSERS.php
/**
     * Local password
     * 
     * @param string $salasana password to hash
     *
     * @return array with hashed password and password hash
     * */
Local password

@param string $salasana password to hash

@return array with hashed password and password hash
Local password @param string $salasana password to hash @return array with hashed password and password hash
private function salakala(string $salasana) 
    {
        $suola = openssl_random_pseudo_bytes(5);
        $salasana = openssl_digest($suola.$salasana, "sha256");
        $d = array(
                   SLSUSERS::SALAISUUSAVAIN=>base64_encode($suola),
                   SLSUSERS::SALAISUUS=>$salasana
        );
        return $d;
    }
private function salakala ( string $ salasana ) { $ suola = openssl_random_pseudo_bytes ( 5 ) ; $ salasana = openssl_digest ( $ suola . $ salasana , " sha256 " ) ; $ d = array ( SLSUSERS :: SALAISUUSAVAIN => base64_encode ( $ suola ) , SLSUSERS :: SALAISUUS => $ salasana ) ; return $ d ; }
Local password
Local password