public function encodeHashOfString($string)
    {

        $salt = $this->getServiceContainer()->getParameter('secret');

        $key = substr(base64_encode($salt), 0, 30);

        $options = array(
            'cost' => 13,
            'salt' => $key
        );

        $hash = hash('sha512', password_hash($string, PASSWORD_BCRYPT, $options));

        return $hash;
    }