I am looking into the possibility of shortening / encrypting a url which will be from 150 to 250 characters in length to maximum 12 characters using an algorithm. Initially I a
The answer, as always, is "it depends". There's a mathematical theory that talks about the "information content" of a bunch of data. If your data is originally strings like this:
lleAgByD2rREjzqj85g68207NsjspdINfPRNvU9udgWw7y4qXh0EQLSy0yEi2
then the information content is much greater than if your strings look like this:
one zero one one zero one zero zero one zero one one zero one
even though the strings are actually the same length. Using compression, you can reduce the number of bits necessary to express the same meaning, but only down to a point. That point depends on the information content of the original message.
It seems unlikely to me that your string of 150 to 250 characters has so little information content that it could be effectively compressed down to 12 characters. You may have to store the longer data in the database and assign a shorter "key" to each data item.
For further reading, one place to start is the Wikipedia article on Information theory.