First Committ
This commit is contained in:
10
src/js/objectId.js
Executable file
10
src/js/objectId.js
Executable file
@@ -0,0 +1,10 @@
|
||||
function objectId() {
|
||||
return hex(Date.now() / 1000)
|
||||
+ ' '.repeat(16).replace(/./g, () => hex(Math.random() * 16))
|
||||
}
|
||||
|
||||
function hex(value) {
|
||||
return Math.floor(value).toString(16)
|
||||
}
|
||||
|
||||
export default objectId
|
||||
Reference in New Issue
Block a user