Php & Sha

Discussion in 'Programming' started by pc_user, Jul 12, 2006.

  1. #1
    Perl has Digest::SHA and with that, you can do a 512 bit, base 64 hash. Does anyone know the php version of this?
     
    pc_user, Jul 12, 2006 IP
  2. giraph

    giraph Guest

    Messages:
    484
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    0
    #2
    $x = base64_encode("blah");
     
    giraph, Jul 15, 2006 IP
  3. pc_user

    pc_user Notable Member

    Messages:
    1,891
    Likes Received:
    94
    Best Answers:
    0
    Trophy Points:
    235
    #3
    Thanks, really appreciate it.
     
    pc_user, Jul 27, 2006 IP
  4. coderlinks

    coderlinks Peon

    Messages:
    282
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hi,
    If I am not mistaken, you wanted to make an irreversible SHA1 hash right? You dont get that with base64_encode function . The string produced can be easily decoded by base64_decode. I think what you are looking for is the sha1 function

    http://in2.php.net/sha

    $hash = sha1("foobar");

    Thomas
     
    coderlinks, Jul 29, 2006 IP