Ruby Gems 1.1.0 is out
Posted by Vince Wadhwani on Mar 30, 2008 in | ruby
Hey, good news, a new version of Ruby Gems is out. The change list for version 1.1.0 looks pretty cool and I'm psyched to have upgraded on my Debian/Sidux development box. If you wan to play along, simply type:
sudo gem update --system
Code to verify and create a mod10 check digit
Posted by Vince Wadhwani on Jan 17, 2008 in | ruby
If you're accepting credit cards in your ruby application you may need to use the Mod10 (also known as a Luhn) algorithm to check the final digit. There's sample code to do that in just about every language including ruby. I'll post my snippet below plus reverse it so you can create a check digit too. Why? Because sometimes you need to do that and also because it never hurts to independently verify your check digit with another method. Here goes: