Archiv der Kategorie ‘Classes‘

 
 

PHP: Easy and secure password hashing class

Everybody talks about security but most of the people still save md5(password) in their databases. This is not funny. Reversing a simple and even a average password is not that hard.
I once wrote this tiny class that generates secure enough password hashes.

Den ganzen Beitrag lesen...

PHP: FIFO queue with APC

A few days ago i needed a simple queue class that would also be persistent after the pagerequest. I first thought about putting this queue in SQL but did not want the whole SQL overhead and such and remembered a blog artice about memcache queues a once read. But i had no memcache for that project and used APC instead.

Den ganzen Beitrag lesen...

Rewrite: PHP String Flipper Class

I found this class on Twitter. Nice idea flipping chars by replacing them with their unicode upside down alternative.
But what bugged me was the code, it looked awful. So id did a rewrite to clean it up a little bit.

Den ganzen Beitrag lesen...

Easy to use and secure PHP hashing Class

Why

I created this class because there are too many people still saving simple md5 instead of more secure hashes.
The class should be fully PHP4 and PHP5 compatible and very easy to use. But also extended usage on its complex methods is possible.

Example

The usage of the class should be straight forward.
If you just want to use it, use the methods hash() and check().
EXAMPLE:

$secure_hash = new secure_hash;
$hash = $secure_hash->hash('pass');
if($secure_hash->check($hash, 'pass'))
  echo "Password fits to hash.";
else
  echo "Password does NOT fit to hash.";

That is all you need to know for just using it, but i have to tell, you will miss something important if you stop reading here.

Den ganzen Beitrag lesen...

Create your own url shortener with this easy to use PHP Class

After using Twitter some time now, i saw several URL shortening services and a few scripts that would do the work. But i did not see any PHP Class for doing this job easily. So i wrote one myself ...

Den ganzen Beitrag lesen...


#