-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timestamp #13
Comments
Yes, but I don't recommend it. You should create a separate timestamp instead. See https://github.com/ericelliott/cuid#broken-down and from the same README...
|
Thanks. On Fri, Oct 10, 2014 at 9:00 PM, Eric Elliott notifications@github.com
Felipe Lorenzo VI |
@ericelliott How can I find the algorithm to get the date from the cuid? From what I see from the README it says that the first 8 characters after the letter 'c' is the timestamp, but how can I convert it to an actual date? And why you don't recommend it? Thanks in advance |
As explained above, and in the documentation, you don't. If you need to know the time something was created, record a separate timestamp. Ids should only be used as ids, and the cuid spec was not designed for data extraction. Groupings do not have guaranteed lengths. |
The security risk associated with extracting metadata from ids is the reason CUID is deprecated and we now prefer CUID2. |
@ericelliott Thank you for your answer. I asked because in our project we just added a field |
Can I get the timestamp from the generated id?
The text was updated successfully, but these errors were encountered: