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 725333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:19:31+00:00 2026-05-14T06:19:31+00:00

How do I use the sha512 function for PHP? Can I replace all my

  • 0

How do I use the sha512 function for PHP?

Can I replace all my md5 functions with the sha512 function?

Do I have to download something if so what?

Can anyone provide examples?

  • 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-14T06:19:31+00:00Added an answer on May 14, 2026 at 6:19 am

    The hash() function, provided with PHP >= 5.1, should be able to generate sha512 hashes — you can verify this calling the hash_algos() function, that lists the supported hashing algorithms.

    For example, you could use :

    $sha512 = hash('sha512', "Hello, World!");
    var_dump($sha512);
    

    And you’d get :

    string '374d794a95cdcfd8b35993185fef9ba368f160d8daf432d08ba9f1ed1e5abe6cc69291e0fa2fe0006a52570ef18c19def4e617c33ce52ef0a6e5fbe318cb0387' (length=128)
    

    And, on my system, the following portion of code :

    $supported = hash_algos();
    var_dump($supported);
    

    Indicates that 42 hashing algorithms are supported :

    array
      0 => string 'md2' (length=3)
      ...
      6 => string 'sha384' (length=6)
      7 => string 'sha512' (length=6)
      8 => string 'ripemd128' (length=9)
      9 => string 'ripemd160' (length=9)
      ...
      40 => string 'haval224,5' (length=10)
      41 => string 'haval256,5' (length=10)
    


    Also, with PHP >= 5.3, you should be able to use the openssl_digest() function :

    $sha512 = openssl_digest("Hello, World!", 'sha512');
    var_dump($sha512);
    

    (Yep, the parameters are not in the same order as with hash() — the magic of PHP, here…)

    And, to get the list of supported algorithms, you could use openssl_get_md_methods().

    On my system, this one gives me 22 supported algorithms.

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

Sidebar

Ask A Question

Stats

  • Questions 452k
  • Answers 452k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Not easily, but it is possible. itemRenderers are stored internally… May 15, 2026 at 9:11 pm
  • Editorial Team
    Editorial Team added an answer I found the answer here and the code excerpt is:… May 15, 2026 at 9:10 pm
  • Editorial Team
    Editorial Team added an answer Unless some new way of doing this has been introduced… May 15, 2026 at 9:10 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.