Can you get this same Java SHA-1 in PHP please?

前端 未结 3 1536
谎友^
谎友^ 2021-01-06 03:28

I find myself in a need to change website platforms from Java to PHP but I\'d like to keep all my user\'s passwords...

I had this code do the password hashing prior

3条回答
  •  太阳男子
    2021-01-06 04:02

    [B@14e1f2b is definitely not a hash. It's a result of implicit conversion from byte[] to String.

    It looks like you do something like this:

    String decodedHash = Base64().decode(hash); // Produces [B@14e1f2b
    

    However, the correct representation of the hash is a byte array:

    byte[] decodedHash = Base64().decode(hash); 
    

提交回复
热议问题