Skip navigation

Category Archives: PHP

Stories tagged ‘PHP’

BackuPing

I hope everyone using WordPress know that it ships with a backup plugin. It’s a great beginner solution that makes people aware that they should care about making backups of their data. But to me it didn’t make the cut a while ago when I really started to care about safe backup of my data. Part of the story is the fact I’ve got two blogs, this one and one in swedish, in addition to some other stuff in a hosted database they all share.

Read the full story

Verhoeff’s Dihedral Group D5 Check

I just finished implementing the Verhoeff checksum algorithm in PHP, you can download it as verhoeff.zip. Yes, mathematically it’s a bit more elaborate than other checksum algorithms, but with look-up tables it’s fairly simple and lightweight.

The implementation provides two functions calcsum($number) and checksum($number). The first one return a check digit for the decimal number used as argument, just append the returned digit to the number and you got yourself a checkable number. The second function checks the number (including the appended check digit) used as argument, the number is only valid if the function return zero.

I noticed a small bug due to a misplace modulus (simple PHP syntax typo), the verhoeff.php is now updated, tested and in working order. The bug only affected the calculation of check digits, not the check function.

Creeper