private function encryptString(string $contents): string
    {
        $resource = $this->getStreamFromString($contents);

        return (string) \stream_get_contents($this->encryptStream($resource));
    }
private function encryptString(string $contents): string
    {
        $resource = $this->getStreamFromString($contents);

        return (string) \stream_get_contents($this->encryptStream($resource));
    }
private function encryptString ( string $ contents ) : string { $ resource = $ this -> getStreamFromString ( $ contents ) ; return ( string ) \ stream_get_contents ( $ this -> encryptStream ( $ resource ) ) ; }
Encrypts a string.

@param string $contents the string to encrypt

@throws \ParagonIE\Halite\Alerts\CannotPerformOperation
@throws \ParagonIE\Halite\Alerts\FileError
@throws \ParagonIE\Halite\Alerts\InvalidDigestLength
@throws \ParagonIE\Halite\Alerts\InvalidKey
@throws \ParagonIE\Halite\Alerts\InvalidMessage
@throws \ParagonIE\Halite\Alerts\InvalidType
@throws \Viserio\Component\Contract\Filesystem\Exception\FileAccessDeniedException
@throws \Viserio\Component\Contract\Filesystem\Exception\FileModifiedException
@throws \Viserio\Component\Contract\Filesystem\Exception\FileNotFoundException

@return string
Encrypts a string .