Skip to content

Instantly share code, notes, and snippets.

View DmitryMarkov's full-sized avatar
🎯
Focusing

Dmitry Markov DmitryMarkov

🎯
Focusing
View GitHub Profile
var mongoObjectId = function () {
var timestamp = (new Date().getTime() / 1000 | 0).toString(16);
return timestamp + 'xxxxxxxxxxxxxxxx'.replace(/[x]/g, function() {
return (Math.random() * 16 | 0).toString(16);
}).toLowerCase();
};