peterhellberg/hashids.rb — pull request #1 by jasonadamyoung (2013-03-28 22:44:01+00:00)
Title: explicitly uses .div instead of '/'

I have a bit of an odd edge case. I have a few projects where I always "require 'mathn'" to essentially return more accurate Rational results from numeric calculations in those projects. Mathn overrides "/" to use #quo instead of #div - returning a Rational instead of a Fixnum

What this meant for hashids.rb is while number > 0 turned into an infinite loop, because numbers < alphabet.length never were 0.

Using .div works great, and I figured I'd pass it along for the incredibly rare individual in the world using both mathn and hashids.