将加密密码分配给变量与将未加密密码分配给另一个变量之间的区别
将加密密码分配给一个变量与将其分配给另一个变量以及在分配过程中加密一次有什么区别吗?
例如:
$myPassword = "1234567";
$crypted_password = "{crypt}".crypt($myPassword);
$userPassword = $crypted_password
和,
$myPassword = "1234567";
$userPassword = "{crypt}".crypt($myPassword);
Is there any difference between assigning an encrypted password to a variable and assigning it to another variable, and encrypting it one time during assignment?
such as:
$myPassword = "1234567";
$crypted_password = "{crypt}".crypt($myPassword);
$userPassword = $crypted_password
and,
$myPassword = "1234567";
$userPassword = "{crypt}".crypt($myPassword);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
第一种情况和第二种情况的结果没有区别,除了一个或两个额外的 CPU 周期进行额外的分配。 不妨直接使用后者,这样更简洁。
No difference in the result between the first case and the second, except an extra CPU cycle or two doing the extra assignment. Might as well just use the latter, it's more concise.
嗯? 我一直在关注,直到你说“一次将其加密分配给所述一个变量会产生影响”......
在没有完全理解你的问题的情况下,我猜测你是在问是否分配加密值中间变量具有任何内在价值。 答案是否定的,事实并非如此。
huh? I was following right up until you said "makes a difference to crypting it one time assigned to the said one variable"...
Without a full understanding of your question, I'm going to guess that you are asking whether assigning the encrypted value to an intermediary variable has any intrinsic value. The answer is no, it doesn't.