Jump to content

sha1 verify


monkeytooth

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.