manual version of https://github.com/jonpollock/ObjectId.js/commit/8740ed99a9131d50eeea5973c84f739902a7b9e8