Jump to content

Recommended Posts

Correct me if I am wrong, I am just want to make sure before I continue with what I am doing. sha1 encrypting/hashing, it only outputs: a-z A-Z 0-9 right? no other characters like $ or % or whatever?

 

I want to verify that what is being passed through a URL is just something equivalent to what a sha1 would put out. If it contains any other form of character then I want to reject it. So am I safe to believe that a-z A-Z 0-9 is all that sha1 outputs as far as characters?

Link to comment
https://forums.phpfreaks.com/topic/184539-sha1-verify/
Share on other sites

$string = "test" which hashed via:
SHA1: a94a8fe5ccb19ba61c4c0873d391e987982fbbd3

 

<?php
// SHA1 tests output
$string = "test";
$sha = sha1($string);

echo '$string = "test" which hashed via:<br />SHA1: ' . $sha . ' <br /> ';
?>

 

Sometimes the best thing to do is just try a simple test script and see.

 

EDIT: To more thoroughly answer your question: SHA Hash Functions Wiki for a good read. So, yes, SHA1 hashes only contain Alpha-numeric.

Link to comment
https://forums.phpfreaks.com/topic/184539-sha1-verify/#findComment-974234
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.