Git Product home page Git Product logo

Comments (5)

mutaku avatar mutaku commented on August 29, 2024

@sublevo you have a good regex idea for this... i guess it's really moot anyway

from stumpy.

sublevo avatar sublevo commented on August 29, 2024

@mutaku doesn't admin have to be admin/? If so then you don't have to worry since the / isn't a valid character in base62. Also can't you just special case those terms in your calls to base62 couldn't you? Like blacklist those names and have it increment one and call it again if that is returned?

from stumpy.

mutaku avatar mutaku commented on August 29, 2024

@sublevo doesn't matter really since django appends slashes anyway. this could be turned off but it's a great feature to have as it saves a lot of headaches when dealing with all the other aspects of urls and kinda unifies everything.
so then you are left with the part before slash which is same as a prospective shortened url. I think there isn't really an easy way around it that i can think of atm moment other than putting the /admin /register etc regexp filters above (so looked at first) in the filter list. This is fine. The problem arises when you would submit link number 150947331 which that id translates to admin in base62. So you see it's still a theoretical and programmatic problem but one that isn't really reasonable for a small DIY project like this.

from stumpy.

mutaku avatar mutaku commented on August 29, 2024

@sublevo so yeah... if we look at urls.py here would be the scenarios (decoding the named directory style redirects):
`>>> import shortener.base62 as b

b.Decode('login').num
316085571
b.Decode('admin').num
150947331
b.Decode('accounts').num
35909104355214L
`

from stumpy.

mutaku avatar mutaku commented on August 29, 2024

closed for sanity.

from stumpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.