monkeytooth Posted December 9, 2009 Share Posted December 9, 2009 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? Quote Link to comment https://forums.phpfreaks.com/topic/184539-sha1-verify/ Share on other sites More sharing options...
premiso Posted December 9, 2009 Share Posted December 9, 2009 $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. Quote Link to comment https://forums.phpfreaks.com/topic/184539-sha1-verify/#findComment-974234 Share on other sites More sharing options...
monkeytooth Posted December 9, 2009 Author Share Posted December 9, 2009 Thank you, and thank you for that wiki link. Quote Link to comment https://forums.phpfreaks.com/topic/184539-sha1-verify/#findComment-974238 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.