Results 1 to 3 of 3

Thread: [RESOLVED] implementing SHA256, 512?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2004
    Posts
    121

    Resolved [RESOLVED] implementing SHA256, 512?

    Hello all.
    When I write the following:
    Code:
    echo sha1($variable_to_encode);
    everything works fine.

    But the same is not true when I replace "sha1" with "sha256" or "sha512".

    I did a:
    Code:
    var_dump(hash_algos());
    and I do have both listed on my system. Plus when I go to php.net/sha256, I don't get documentation the way you would with any other function.
    If anyone could help me realize what I'm doing wrong I'd appreciate it.
    Thanks.
    Last edited by solitario; Jan 24th, 2008 at 09:35 AM.

  2. #2
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: implementing SHA256, 512?

    Use the hash() function. It supports a number of different message digest systems, just change the first parameter.
    PHP Code:
    echo hash("sha512","string to encrypt"); 
    http://www.php.net/manual/en/function.hash.php
    Chris

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2004
    Posts
    121

    Re: implementing SHA256, 512?

    simple enough. thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width