Comments (2)
timestamp+machineid+programid+counter
produces an amazing amount of entropy so collisions would be pretty phenomenal.
... but, if folks want to specify a machine id- sure they can use it at their own risk! setMachineId
will just need to validate that the input is an int
. Just know that it will truncate that int
to the last 6 hex chars. (That mirrors how the bson
lib works)
PRs always welcome!
from bson-objectid.
In browser MACHINE_ID
will be regenerated each time user open/close application, that's why I want to ensure that it's a static unique number for this user which doesn't change
Update:
Cool! I will work on PR tomorrow :)
from bson-objectid.
Related Issues (20)
- Publishing `.idea` folder to npm HOT 1
- Can you make this work in a browser? HOT 1
- Typescript errors HOT 3
- Cannot get version 1.2.4 from npm HOT 2
- Wrong typing for getTimestamp() HOT 1
- ObjectID.isValid should check that `typeof toString === 'function'` otherwise if it's not an object and doesn't have a `toString` then it would return false HOT 5
- No changelog HOT 2
- A vulnerability in ObjectID() HOT 11
- Cannot use namespace 'Buffer' as a type. HOT 3
- Typescript import issue HOT 2
- Types have not been updated and ObjectId.generate is no longer being exported HOT 2
- ObjectID.isValid function return true for number HOT 7
- Globally Unique HOT 6
- Api is not matching the one from `bson` - `createFromTime` HOT 1
- Api is not matching the one from `bson` - `getTimestamp` HOT 4
- Getter ObjectID.str returns undefined HOT 1
- IsValid returns true for invalid binary data HOT 2
- Uncaught ReferenceError: _Buffer is not defined HOT 2
- Type for ObjectID does not match mongodb ObjectId HOT 1
- Buffer types are not checked properly HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bson-objectid.