3 ms·
This is why people use base48 or base36 for binary data in URLs. There is a really good reason to store these things in the database though, and that's on-dema
by tinco 12y ago
This is why people use base48 or base36 for binary data in URLs.
There is a really good reason to store these things in the database though, and that's on-demand authorization retraction.
- tracker1 12y agoyou can always use base64-url structure too... base64, remove trailing "="'s, replace "+" with "-", replace "/" with "_". Though the "_" and "-" can still be ugly at the beginning or end. You can also encode them %## style.
- bjt 12y agoYou can still do that on-demand retraction as long as the hash is fed something from the database that you can change. IIRC, Django uses both password and last login timestamp inside the hash. If you needed to invalidate someone's token you could just add 1 millisecond to their last login time.