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.
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.