Giter VIP home page Giter VIP logo

Comments (1)

ocram avatar ocram commented on August 22, 2024

Sure!

In order to guarantee an upper limit on the output, just put an upper limit on the input. With the integer types tinyint, smallint or int, you should not exceed 12 characters of output at all. If you need larger inputs, e.g. from bigint, your maximum input number for n characters of output is 51^n − 1. There's no other way to make the upper limit work.

Since what you want is 12 characters of output for every input, you need a lower limit as well.

The only way to make that work is by padding (e.g. on the left). Pad the output with a fixed character that is not in the alphabet of this library, up to your desired character length. If you need more variation and "randomness" in your output, consider using a set of multiple padding characters, neither of which may be in this library's alphabet. Choose the next padding character from set set randomly.

Hope that helps!

from shorturl.

Related Issues (14)

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.