将加密密码分配给变量与将未加密密码分配给另一个变量之间的区别

发布于 2024-08-01 15:57:45 字数 306 浏览 4 评论 0原文

将加密密码分配给一个变量与将其分配给另一个变量以及在分配过程中加密一次有什么区别吗?

例如:

$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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

汐鸠 2024-08-08 15:57:45

第一种情况和第二种情况的结果没有区别,除了一个或两个额外的 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.

偷得浮生 2024-08-08 15:57:45

嗯? 我一直在关注,直到你说“一次将其加密分配给所述一个变量会产生影响”......

在没有完全理解你的问题的情况下,我猜测你是在问是否分配加密值中间变量具有任何内在价值。 答案是否定的,事实并非如此。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文