php hash form string to integer

前端 未结 3 831
死守一世寂寞
死守一世寂寞 2020-12-17 15:34

Does PHP have a built in function for doing string to integer hashes, something that\'s difficult to reverse?

Now, I know I can probably get away with doing an md5,

3条回答
  •  时光取名叫无心
    2020-12-17 16:06

    I think the best bet would chose a standard hash [either md5() or sha1()] to obtain a hash of your string, and then to get an integer hash, to a base_convert($hash, 16, 10) and that should convert your hash into a integer hash.

    Hope I am understanding your issue correctly.

提交回复
热议问题