(dateString: string, slug: string)
| 15 | |
| 16 | // Parse date from frontmatter, add slug-path entropy for same-date collision resolution |
| 17 | export const generateBlogTID = (dateString: string, slug: string): string => { |
| 18 | let timestamp = Date.parse(dateString) |
| 19 | |
| 20 | if (timestamp % ONE_DAY_MILLISECONDS === 0) { |
| 21 | const offset = simpleHash(slug) % 1000000 |
| 22 | timestamp += offset |
| 23 | } |
| 24 | |
| 25 | // Clock id(3) needs to be the same everytime to get the same TID from a timestamp |
| 26 | return TID.create(timestamp * MS_TO_MICROSECONDS, TID_CLOCK_ID) |
| 27 | } |
| 28 | |
| 29 | // Using our release date as the tid for the publication |
| 30 | export const npmxPublicationRkey = () => |
no test coverage detected