可能重复:
PHP双向加密:我需要存储可以检索的密码
我计划在我的网站上为我的用户存储外国帐户信息,也就是用户名和密码等等...我想保证信息的安全,但我知道如果我散列他们的信息,我无法检索它以供以后使用.
Base64是可解密的,所以没有必要使用它只是简单的关闭.我的想法是加扰用户并在它解密之前和之后通过这种方式传递,如果你尝试解密,你会得到一些看起来很有趣的文本.是否有一个php函数接受将进行字符串的唯一加扰的值,并在以后重新计算该值时对其进行解扰?
有什么建议?
我在我的服务器上有一个视频,我希望通过html 5视频播放器与PHP流.我找到了一个类(https://gist.github.com/ranacseruet/9826293),但它不适用于大文件.我该怎么做才能正确显示视频?
class VideoStream
{
private $path = "";
private $stream = "";
private $buffer = 102400;
private $start = -1;
private $end = -1;
private $size = 0;
function __construct($filePath)
{
$this->path = $filePath;
}
/**
* Open stream
*/
private function open()
{
if (!($this->stream = fopen($this->path, 'rb'))) {
die('Could not open stream for reading');
}
}
/**
* Set proper header to serve the video content
*/
private function setHeader()
{
ob_get_clean();
header("Content-Type: video/mp4");
header("Cache-Control: …Run Code Online (Sandbox Code Playgroud)