beatfreaker / text-meme

Generate text meme
MIT License
9 stars 1 forks source link

Improve default name generation #2

Open sindresorhus opened 8 years ago

sindresorhus commented 8 years ago

There could easily be a conflict as your random generation isn't very high resolution.

https://github.com/beatfreaker/text-meme/blob/1e513e8ceda8c8af3e280a9aaca6759ef1c0ba7d/index.js#L56

I would use randomInt(100, 99999) and also check if the image exists before writing and generate a new number if it does. You never want to accidentally overwrite an existing image.

beatfreaker commented 8 years ago

:+1: