PHP internal hashCode Function

后端 未结 5 706
孤独总比滥情好
孤独总比滥情好 2021-02-09 14:59

I am looking for the PHP equelent to JAVA\'s

 \"SomeString\".hashCode();

function. The hashCode i am looking for should be the same which is u

5条回答
  •  被撕碎了的回忆
    2021-02-09 15:13

    There is no such method available in php. So you will have to implement the correct method. Wikipedia gives the algorithm used by Java.lang.hashCode which is used by strings I think, so here is a quick php version of it:

提交回复
热议问题