PHP 会话在存储 id 时使用什么哈希? [英] What hash do PHP sessions use when storing an id?

查看:39
本文介绍了PHP 会话在存储 id 时使用什么哈希?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

算法是什么.我想使用相同的算法手动创建我自己的 session_ids,我也想将其存储在本地.

What is the algorithm. I would like to use the same algorithm to manually create my own session_ids which I want to store locally as well.

我意识到我可以在服务器端创建它(使用会话函数)并发送它...但我更喜欢自己对它进行散列/编码...+我想要增加我喜欢的复杂性的选项...摆弄它等

I realize I could create it server side ( using session functions ) and send it...but I just prefer to hash / encode it myself...+ I want the option to increase the complexity to my liking...fiddle with it etc.

相关:1

谢谢.

推荐答案

PHP 默认使用 md5,但可以配置为使用 sha-1 以及从 PHP 5.3 开始的许多其他散列算法.

PHP uses md5 by default, but can be configured to use sha-1 and as of PHP 5.3 many other hashing algorithms.

您可以选择自己的算法,但它至少应该与 md5 一样强大,并且可能应该更强大,因为 md5 有点过时了.

You can choose your own algorithm, but it should be at least as strong as md5 and probably should be stronger as md5 is getting a bit out of date.

这篇关于PHP 会话在存储 id 时使用什么哈希?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆