Trying to port C# function to PHP5

血红的双手。 提交于 2019-12-07 23:58:34

Once I used SHA1 in PHP and C# and in C# output letters were in uppercase and in PHP it was in lowercase.

I would recommend to use the same encoding in C# and in PHP (UTF8 and UTF16 are good choices).

Choices in C#:

  • Encoding.ASCII.GetBytes
  • Encoding.UTF8.GetBytes
  • ...

encoding PHP:

You need to tell PHP to encode the password string using UTF16 and the salt as raw bytes.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!