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

  • Home
  • SEARCH
  • 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 3954550
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:06:47+00:00 2026-05-20T02:06:47+00:00

I trying to create an array of filename hashes (key) and filenames (value), but

  • 0

I trying to create an array of filename hashes (key) and filenames (value), but most functions I use don’t seem to work like I want them to…

Why are these functions when used in a loop resulting in the same output string while the input string varies? md5 and sha1 don’t have this problem, but aren’t reversible and that’s needed.

foreach ($files as $file)
{
  debug(array(bin2hex($file), $file));
}

// result
app/views/helpers/monolith.php (line 45)

Array
(
    [0] => 2f686f6d652f6d746572736d697474656e2f7075626c69635f68746d6c2f6170702f707269766174652f6d622f323031302f31322e706466
    [1] => /home/mtersmitten/public_html/app/private/mb/2010/12.pdf
)


app/views/helpers/monolith.php (line 45)

Array
(
    [0] => 2f686f6d652f6d746572736d697474656e2f7075626c69635f68746d6c2f6170702f707269766174652f6d622f323031302f31312e706466
    [1] => /home/mtersmitten/public_html/app/private/mb/2010/11.pdf
)


app/views/helpers/monolith.php (line 45)

Array
(
    [0] => 2f686f6d652f6d746572736d697474656e2f7075626c69635f68746d6c2f6170702f707269766174652f6d622f323031302f31302e706466
    [1] => /home/mtersmitten/public_html/app/private/mb/2010/10.pdf
)

I hope this example is more clear…

  • 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-05-20T02:06:47+00:00Added an answer on May 20, 2026 at 2:06 am

    In fact the strings are different. You should check more carefully. They are the same for the most part, because both bin2hex and base64_encode encode the sequence of bytes and do not generate a hash like sha1 or md5.

    bin2hex just converts every character in the string to its hex value and as for base64, check the wikipedia article to see exactly why the string is the same for large part of the outcome

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to create an array or has of ids and names but @campaign_ids_and_names =
Im trying to create an array of tm* structs, and then return them at
I am trying to create an array of product SKU's which I can then
I'm trying to create an array from selected table rows so I can push
I am trying to create an array of class objects taking an integer argument.
I'm trying to create an array to display the last 5 products a customer
I am trying to create an array or list that could handle in theory,
I'm trying to create an array of strings that can be randomized and limited
I'm trying to create an array (States) of arrays (Cities). Whenever I try to
I'm trying to create an array in MIPS Assembly, and then add all the

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.