shortpaste icon indicating copy to clipboard operation
shortpaste copied to clipboard

auto generate numbers

Open TWART016 opened this issue 4 years ago • 3 comments

Hi,

is it possible if I leave the ID empty that the generator creates just numbers, best incrementing from 1 or 100?

TWART016 avatar Jan 05 '22 11:01 TWART016

Hi @TWART016 ,

It is possible, quite easily to implement that. The problem with sequential IDs is that, since this is meant to be accessible via the internet, people can guess the previous or the next short, which is not at all what I would expect people to be able to do. It is security by obscurity, but it need not be secure, only obscure enough so people cannot just export out everything.

What's your use case? If that is absolutely needed, it can be placed behind an environment flag to switch the behaviour.

adyanth avatar Jan 05 '22 11:01 adyanth

Hi @adyanth,

thanks for your feedback.

I just want to use the service in my internal network. I want to share code on different client.

If I want to access it via the internet I can define the ID manually and more complex.

So a environment flag would be great.

TWART016 avatar Jan 05 '22 12:01 TWART016

Hey @TWART016 , understood. Makes sense, the IDs will be easier to remember.

I'll have a crack at it when I get some time soon. PRs are welcome too!

adyanth avatar Jan 05 '22 16:01 adyanth