Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7926029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:33:50+00:00 2026-06-03T18:33:50+00:00

Friends my php 5.2 codes am keeping my password like this echo ‘<br>’.base64_encode(mhash(MHASH_MD5,’test’)); result

  • 0

Friends my php 5.2 codes am keeping my password like this

echo '<br>'.base64_encode(mhash(MHASH_MD5,'test'));
result  CY9rzUYh03PK3k6DJie09g==

In php 5.3 mhash extension is obsoleted by Hash like I saw in there documentation. So I tried like this. But its giving wrong result.

echo '<br>'.base64_encode(hash(MD5,'test'));
result MDk4ZjZiY2Q0NjIxZDM3M2NhZGU0ZTgzMjYyN2I0ZjY=

Please help me to convert my 5.2 mhash codes to 5.3.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T18:34:01+00:00Added an answer on June 3, 2026 at 6:34 pm

    Actually, they are the same, only in a different format.
    The first one is binary data, while the second one is hexadecimal.
    You can convert the first one to the second using this function:

    $second_hash = bin2hex ($first_hash);
    

    Or the other way around:

    $first_hash = hex2bin ($second_hash);
    

    Update

    Add this function:

    define('HEX2BIN_WS', " \t\n\r");
    
    function hex2bin($hex_string) {
        $pos = 0;
        $result = '';
        while ($pos < strlen($hex_string)) {
          if (strpos(HEX2BIN_WS, $hex_string{$pos}) !== FALSE) {
            $pos++;
          } else {
            $code = hexdec(substr($hex_string, $pos, 2));
            $pos = $pos + 2;
            $result .= chr($code); 
          }
        }
        return $result;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

$LINE = $User.,.$data[$k][10]; echo $LINE; $str=implode(,file('Friends.php')); $fp=fopen('Friends.php','w+'); $str=str_replace($User,$LINE,$str); fwrite($fp,$str,strlen($str)); OK, this code is a
Hello friends a newbie question... The Issue is like this: I have a static
i use this code to get info about friends <?php $fql = SELECT uid,
I'm using the latest PHP SDK and have tried $facebook->('/me/friends?fields=installed') and it tells me
I am developing a website using CodeIgniter and PHP. Some of my friends suggest
hello frieds this is how i usually post a variable using Jquery.. $.post(include/save_legatee.inc.php, {
I have this code: $url=https://graph.facebook.com/me/friends?access_token=.$access_token.&fields=id,first_name,last_name&limit=10; $content=file_get_contents($url); Whenever I use this on a non authenticated
I'm using the Facebook php-sdk to get the users name and friends, right now
From this XML response: http://www.dreamincode.net/forums/xml.php?showuser=335389 I want to grab all of the users friends.
i have this bit of html. (Link at bottom) Its output of php code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.