4 ms·
An easy solution to that is simply not to start at zero/one and pick a random number somewhere around 5-6 digits. Can do that at the database level or programat
by adjkant 7y ago
An easy solution to that is simply not to start at zero/one and pick a random number somewhere around 5-6 digits. Can do that at the database level or programatically.
- jstanley 7y agoIt's still easy for anyone to work out how fast you're gaining users. Just sign up for an account every day and note how much higher the new id is.
- thecatspaw 7y agoyou can also add zeroes (or other digits which get stripped before used for querying) at the end, that way the gain looks orders of magnitudes faster
- jstanley 7y agoSure, but anyone signing up for 3 accounts in quick succession can probably figure out what you're doing. All of these problems go away if you just assign random numbers instead.
- TeMPOraL 7y agoWhy would honest people want to spend time implementing ways to lie to their users? Because that's what we're talking about here. (And I know I'm asking a rhetorical question.)
- jstanley 7y agoAssigning random ids isn't lying to your users, unless you also make representations that the user id corresponds to the number of users that there are.
- verbify 7y agoWhile there might be some edge cases (e.g. startups associated with a high profile brand/person), in most cases there are usually better things for a startup to do than obfuscate the number of users they're gaining.
- treve 7y agoA slightly more advanced version of this to XOR the number with some other number.
- codetrotter 7y agoSimply doing XOR on two integers doesn’t really provide meaningful obfuscation if one of the inputs are constant as I assume they would be in this case. For example: for i in range(25): 167535774 ^ i 167535774 167535775 167535772 167535773 167535770 167535771 167535768 167535769 167535766 167535767 167535764 167535765 167535762 167535763 167535760 167535761 167535758 167535759 167535756 167535757 167535754 167535755 167535752 167535753 167535750 for i in range(250000,250025): 167535774 ^ i 167752718 167752719 167752716 167752717 167752714 167752715 167752712 167752713 167752710 167752711 167752708 167752709 167752706 167752707 167752704 167752705 167752766 167752767 167752764 167752765 167752762 167752763 167752760 167752761 167752758
- eli 7y agoAt that point your requirements seem to require a number with no pattern, so it should probably just be a random unique number or string. But for a lot of use cases the ability to measure growth or enumerate URLs doesn't matter.