{"action":"created","issue":{"url":"https://api.github.com/repos/ircmaxell/RandomLib/issues/38","labels_url":"https://api.github.com/repos/ircmaxell/RandomLib/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/ircmaxell/RandomLib/issues/38/comments","events_url":"https://api.github.com/repos/ircmaxell/RandomLib/issues/38/events","html_url":"https://github.com/ircmaxell/RandomLib/issues/38","id":104960140,"number":38,"title":"7 character base62 collision","user":{"login":"kbond","id":127811,"avatar_url":"https://avatars.githubusercontent.com/u/127811?v=3","gravatar_id":"","url":"https://api.github.com/users/kbond","html_url":"https://github.com/kbond","followers_url":"https://api.github.com/users/kbond/followers","following_url":"https://api.github.com/users/kbond/following{/other_user}","gists_url":"https://api.github.com/users/kbond/gists{/gist_id}","starred_url":"https://api.github.com/users/kbond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbond/subscriptions","organizations_url":"https://api.github.com/users/kbond/orgs","repos_url":"https://api.github.com/users/kbond/repos","events_url":"https://api.github.com/users/kbond/events{/privacy}","received_events_url":"https://api.github.com/users/kbond/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-04T20:00:00Z","updated_at":"2015-09-11T19:35:21Z","closed_at":"2015-09-05T16:39:11Z","body":"Hello, I am using this library to generate unique 7 character base62 strings. My code is similar to the following:\r\n\r\n```php\r\n$charset = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\r\n\r\nreturn (new Factory())->getMediumStrengthGenerator()->generateString(7, $charset);\r\n```\r\n\r\nAfter seeing this issue: https://github.com/ramsey/uuid/issues/80 I was wondering if my system would have collisions as well. I tried a variation of [this script](https://github.com/ramsey/uuid/issues/80#issuecomment-135472796) and indeed, I had a collision after about 1.2 million generated strings. It is my understanding that there are over 2 trillion possibilities with my system. \r\n\r\nI tried increasing the length to 10 (which would give like 400 quadrillion possibilities) and after 12 million keys there were no collisions.\r\n\r\nI'm trying to understand why 7 isn't good enough.\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/ircmaxell/RandomLib/issues/comments/139643386","html_url":"https://github.com/ircmaxell/RandomLib/issues/38#issuecomment-139643386","issue_url":"https://api.github.com/repos/ircmaxell/RandomLib/issues/38","id":139643386,"user":{"login":"kbond","id":127811,"avatar_url":"https://avatars.githubusercontent.com/u/127811?v=3","gravatar_id":"","url":"https://api.github.com/users/kbond","html_url":"https://github.com/kbond","followers_url":"https://api.github.com/users/kbond/followers","following_url":"https://api.github.com/users/kbond/following{/other_user}","gists_url":"https://api.github.com/users/kbond/gists{/gist_id}","starred_url":"https://api.github.com/users/kbond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbond/subscriptions","organizations_url":"https://api.github.com/users/kbond/orgs","repos_url":"https://api.github.com/users/kbond/repos","events_url":"https://api.github.com/users/kbond/events{/privacy}","received_events_url":"https://api.github.com/users/kbond/received_events","type":"User","site_admin":false},"created_at":"2015-09-11T19:35:21Z","updated_at":"2015-09-11T19:35:21Z","body":"Anthony, can you tell me how you make those calculations?"}}