如何缩短URL中的数学方法

编程入门 行业动态 更新时间:2024-10-24 10:25:37
本文介绍了如何缩短URL中的数学方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我期待到缩短/加密,这将是使用一种算法长度150至250个字符至最大12字符的URL的可能性。最初,我怀疑这是可能的,但我想利用计算器的伟大人物:)

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 am doubting it's possible but I wanted to leverage the great minds of StackOverflow :)

算法应该是一个可以在传统的ASP,SQL,C#,VB编写,或FOXPRO或其他语言。

the algorithm should be one that can be written in classic asp, sql, c#, vb, or foxpro or other language.

是,即使可能没有数据库为中心的方法?

Is that even possible without a database centric approach?

我读here该AES在CFB模式,将做一个流加密和输出长度将是相同的作为输入的长度。有什么办法缩短它更?

I was reading here that AES in CFB mode, will do a stream cipher and the output length will be the same as the input length. Is there any way to shorten it even more?

推荐答案

答案,一如既往,是看情况。有这么谈论一组数据的信息含量一个数学理论。如果你的数据是原来的字符串是这样的:

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

即使串实际上是相同的长度。使用COM pression,可以减少必要的前preSS的相同的含义的比特数,但只下降到一个点。这点取决于原始邮件的信息内容。

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.

这似乎不太可能,我认为你的150至250个字符的字符串有可能是有效的COM pressed下降到12个字符这么少的信息内容。可能必须在较长的数据存储在数据库中,并分配较短的钥匙的每个数据项

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.

更多推荐

如何缩短URL中的数学方法

本文发布于:2023-11-30 01:17:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1648232.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数学   方法   URL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!