md5 perl & php

Discussion in 'PHP' started by mero2020, Dec 21, 2013.

  1. #1
    I want to convert this to php

    $data{'password'} = md5_base64( $data{'password'} )
    
    Code (markup):
    I tried this but failed

    $password =  md5($password);
    $password = base64_encode($password);
    PHP:

     
    mero2020, Dec 21, 2013 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    Found this:
    
    
    <?php 
    function md5_base64 ( $data ) 
    { 
      return preg_replace('/=+$/','',base64_encode(pack('H*',md5($data)))); 
    } 
    ?>
    
    PHP:
    here: http://www.php.net/md5


    Might work, I haven't tested
     
    PoPSiCLe, Dec 21, 2013 IP
  3. mero2020

    mero2020 Greenhorn

    Messages:
    20
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    13
    #3
    Thanks PoPSICLe ,Solved
     
    mero2020, Dec 22, 2013 IP