5 ms·
How do you adjust or evolve the blocklist with this, without making previously generated IDs incorrect? The ID is simply incremented if it is blacklisted [1].
by orf 3y ago
How do you adjust or evolve the blocklist with this, without making previously generated IDs incorrect?
The ID is simply incremented if it is blacklisted [1]. So the ID is fixed to the blacklist content, and adjusting it in any way invalidates certain segments of previously generated IDs?
1. https://github.com/sqids/sqids-rust/blob/9f987886bc06875d7828f843be8e154938140cb0/src/lib.rs#L215 https://github.com/sqids/sqids-rust/blob/9f987886bc06875d782...
- ec109685 3y agoThey address it here: https://sqids.org/faq#future-blocklist https://sqids.org/faq#future-blocklist You're right that you can't update the blocklist in a backwards compatible way.
- Guillaume86 3y agoDidn't check the code but you could encode offseted hash + the offset to avoid blacklisted words and the decoder would decode any version of the hash (offseted or not).
- timwis 3y agoInclude a version prefix perhaps?