JavaScript Luhn modulus implementation

The following luhn_check() function is a small JavaScript function which checks whether a number is a valid based on the Luhn algoritm. One common example of use is with credit and debit card numbers. This function may be used to check for valid credit card numbers, however additional checks may be desired, such as card prefix and length checks.

There’s a…

Posted in: Code Snippets by Plan Zero 4 Comments

PHP Luhn modulus implementation

The following luhn_check() function is a small PHP function which checks whether a number is a valid based on the Luhn algorithm. One common example of use is with credit and debit card numbers. This function may be used to check for valid credit card numbers, however additional checks may be desired, such as card prefix and length checks.


<?php
/* Luhn…

Posted in: Code Snippets by Plan Zero 6 Comments

An introduction to the vi editor

Back in 2006 I wrote an article on the vi text editor. While I’m in the process of rearranging my site, the time seems right to republish the article. Read and enjoy!

The history of vi

The vi text editor originated at the University of California in Berkeley. Created by Bill Joy in 1976 as a replacement for the frustrating ed line…

Posted in: Tutorials by Plan Zero 2 Comments