src/Controller/MelisAuthController.php
protected function crypt($data, $type = 'encrypt')
    {
        $melisConfig = $this->getServiceLocator()->get('MelisCoreConfig');
        $datas = $melisConfig->getItemPerPlatform('meliscore/datas');

        $hashMethod = $datas['accounts']['hash_method'];
        $salt = $datas['accounts']['salt'];

        if ($type == 'encrypt') {
            return base64_encode($data);
        }

        if ($type == 'decrypt') {
            return base64_decode($data);
        }

        return;
    }
protected function crypt($data, $type = 'encrypt')
    {
        $melisConfig = $this->getServiceLocator()->get('MelisCoreConfig');
        $datas = $melisConfig->getItemPerPlatform('meliscore/datas');

        $hashMethod = $datas['accounts']['hash_method'];
        $salt = $datas['accounts']['salt'];

        if ($type == 'encrypt') {
            return base64_encode($data);
        }

        if ($type == 'decrypt') {
            return base64_decode($data);
        }

        return;
    }
protected function crypt ( $ data , $ type = 'encrypt' ) { $ melisConfig = $ this -> getServiceLocator ( ) -> get ( 'MelisCoreConfig' ) ; $ datas = $ melisConfig -> getItemPerPlatform ( 'meliscore/datas' ) ; $ hashMethod = $ datas [ 'accounts' ] [ 'hash_method' ] ; $ salt = $ datas [ 'accounts' ] [ 'salt' ] ; if ( $ type == 'encrypt' ) { return base64_encode ( $ data ) ; } if ( $ type == 'decrypt' ) { return base64_decode ( $ data ) ; } return ; }
Encryption of passwords for melis

@param array $data
@param string $type

@return string
Encryption of passwords for melis