Convert base64'd SHA1 hashes to Hex hashes

后端 未结 2 1201
萌比男神i
萌比男神i 2021-01-12 05:19

I have a list of passwords in mySQL that are generated using

$hash = \'{SHA}\' . base64_encode(sha1(\'some string here\', true));

I need t

相关标签:
2条回答
  • 2021-01-12 05:46
    $binary = base64_decode(substr($hash, 5));
    $hex = bin2hex($binary);
    
    0 讨论(0)
  • 2021-01-12 06:04

    Well base64_decode() can be found in the base64_encode manual entry.
    And I am sure they have a way to convert raw format in the sha1 manual entry comments, if it's too hard for you to write it yourself

    0 讨论(0)
提交回复
热议问题