{"action":"created","issue":{"url":"https://api.github.com/repos/dylang/shortid/issues/81","repository_url":"https://api.github.com/repos/dylang/shortid","labels_url":"https://api.github.com/repos/dylang/shortid/issues/81/labels{/name}","comments_url":"https://api.github.com/repos/dylang/shortid/issues/81/comments","events_url":"https://api.github.com/repos/dylang/shortid/issues/81/events","html_url":"https://github.com/dylang/shortid/issues/81","id":188608528,"node_id":"MDU6SXNzdWUxODg2MDg1Mjg=","number":81,"title":"Specify id length","user":{"login":"praxiq","id":605533,"node_id":"MDQ6VXNlcjYwNTUzMw==","avatar_url":"https://avatars1.githubusercontent.com/u/605533?v=4","gravatar_id":"","url":"https://api.github.com/users/praxiq","html_url":"https://github.com/praxiq","followers_url":"https://api.github.com/users/praxiq/followers","following_url":"https://api.github.com/users/praxiq/following{/other_user}","gists_url":"https://api.github.com/users/praxiq/gists{/gist_id}","starred_url":"https://api.github.com/users/praxiq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praxiq/subscriptions","organizations_url":"https://api.github.com/users/praxiq/orgs","repos_url":"https://api.github.com/users/praxiq/repos","events_url":"https://api.github.com/users/praxiq/events{/privacy}","received_events_url":"https://api.github.com/users/praxiq/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-10T20:20:30Z","updated_at":"2018-07-08T03:58:00Z","closed_at":"2018-07-08T03:57:59Z","author_association":"NONE","body":"The automatic scaling of id length based on generation rate is pretty cool, but it has some drawbacks.\r\n\r\n1. As one user pointed out, if ids are generated rapidly in clusters, it can create ids that are too long.\r\n2. If run for a long time at a low rate, it can create ids that are too short! Generating 1 id per second, the ids stay short (9 characters = 54 bits). After only a year (30 million ids) the odds of a collision increase to 2.5%. (And if 4 different servers each generate 1 id per second, it'll only take 3 months to get the same odds of a collision!)\r\n\r\nWhen I know my own use case and how important it is to me to avoid a collision, I'd like to be able to skip the timing code and just specify the length myself.\r\n\r\nIt'd be nice if I could call generate(12), and get output of the specified length. (Or, generateFixed could be its own function, separating out the timing code completely for those who don't want it to be part of their project.)"},"comment":{"url":"https://api.github.com/repos/dylang/shortid/issues/comments/403260448","html_url":"https://github.com/dylang/shortid/issues/81#issuecomment-403260448","issue_url":"https://api.github.com/repos/dylang/shortid/issues/81","id":403260448,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMzI2MDQ0OA==","user":{"login":"ai","id":19343,"node_id":"MDQ6VXNlcjE5MzQz","avatar_url":"https://avatars1.githubusercontent.com/u/19343?v=4","gravatar_id":"","url":"https://api.github.com/users/ai","html_url":"https://github.com/ai","followers_url":"https://api.github.com/users/ai/followers","following_url":"https://api.github.com/users/ai/following{/other_user}","gists_url":"https://api.github.com/users/ai/gists{/gist_id}","starred_url":"https://api.github.com/users/ai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ai/subscriptions","organizations_url":"https://api.github.com/users/ai/orgs","repos_url":"https://api.github.com/users/ai/repos","events_url":"https://api.github.com/users/ai/events{/privacy}","received_events_url":"https://api.github.com/users/ai/received_events","type":"User","site_admin":false},"created_at":"2018-07-08T03:57:59Z","updated_at":"2018-07-08T03:57:59Z","author_association":"COLLABORATOR","body":"This library doesn’t have this API since it is dynamic ID length.\r\n\r\nUse [Nano ID](https://github.com/ai/nanoid), where you can change ID length."}}
{"actor":{"display_login":"ai"}}