SHA256 version 2.0 alpha 3 - updated
Moderator: General Moderators
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
Ok, ok... it's just that you were the last person I expected to write a code like:

Code: Select all
$this->noExt = is_bool($noExt) && $noExt === true;- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
The code isn't about speed so much as it is in readability (as much as possible anyways) for users who are curious enough to look. That's why it's commented even more than the original.
Unfortunately, the workhorse function(s) cannot easily be rewritten for easier "newb" reading, although I did my best to make it easier to follow what's happening.
Unfortunately, the workhorse function(s) cannot easily be rewritten for easier "newb" reading, although I did my best to make it easier to follow what's happening.
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
I believe that in the Urlinput.class.php for PHP 5, in the following code, $filename should be $url.
Code: Select all
if (!is_scalar($url))
{
trigger_error('UrlInput(' . var_export($filename, true) .
'): cannot be opened.',
E_USER_ERROR);
}Yeah stuff like that is easy to miss. I was looking through your code to see if I could pick up any new tricks. What stuck out the most is your use of is_scalar. I can't imagine any decent programmer passing an array instead of a string, but stranger things have happened I'm sure. Nevertheless, now I know how to make sure something isn't an object, array or resource 
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Yeah, is_scalar() is a nice little function not often used.
- Maugrim_The_Reaper
- DevNet Master
- Posts: 2704
- Joined: Tue Nov 02, 2004 5:43 am
- Location: Ireland
Hi Feyd,
Been using the code quietly since the very first release
. I have almost a dozen applications in PHP4 depending on it. In a month or two it may also be bundled in another public library for PHP4 (already have a PHP5 specific version) for OpenID 2.0 which recommends SHA256 HMAC signatures. You can guess who'll be responsible for the bumped up security needed
.
Kudos...again... This is a really useful class to have around.
Been using the code quietly since the very first release
Kudos...again... This is a really useful class to have around.
Hi,
I'm having strange issue with latest (?) release 2.0 alpha v. 3. I have PHP version 5.0.5 according phpinfo(); and cPanel. Still i'm getting parse error if i'm using PHP 5 version of this SHA256 files. When using PHP 4 files, everything ok.
It isn't that big problem as it's working with PHP 4 files, but would be nice to know whether it is a problem with the script or web server.
Greetings,
Kalle
I'm having strange issue with latest (?) release 2.0 alpha v. 3. I have PHP version 5.0.5 according phpinfo(); and cPanel. Still i'm getting parse error if i'm using PHP 5 version of this SHA256 files. When using PHP 4 files, everything ok.
It isn't that big problem as it's working with PHP 4 files, but would be nice to know whether it is a problem with the script or web server.
Greetings,
Kalle