justaprogrammer/ObjectId.js — pull request #4 by piacentini (2013-07-02 19:01:28+00:00)
Title: Minor fixes

Hi. I was testing your class and found two minor issues, please see the attached merge request. One has been reported before and it is harmless as the current timestamp returned by a date object already converts to a 8 digit HEX string. But as you are checking anyway, it is nice to use the correct mask size (8 characters).
The second is an off by one comparison. I simply change the location of the increment, alternatively you could also use a >= when comparing the upper limit of the increment value.
BTW I have a PHP version of this class if you are interested, not sure if it is ok to post it here or not.