English 中文(简体)
在URL缩短时使用Bijective Dictionary
原标题:Using a Bijective Dictionary in a URL shortener

我正在创造一个新的《欧洲功能》缩短时间,并读到,“Bijective”功能是需要的。 因此,我发现。 Jon Skeet s BiDictionary(阁下),并想知道我如何在URL的缩短申请中加以利用。 目前,I Base36将数据库ID栏编码,以创建我缩短的URL,并将全部URL储存在表格中。 这对我为什么需要使用“Bijective”职能,却失去了意义。 我是否将数据库中的数值储存在Bijective Dictionary? 我目前是否有足够的职能? 使用Bijective Dictionary有什么好处?

最佳回答

Not really sure that I understand you question fully...

If I understand you correctly you have created a lookup table with a unique ID and a URL. Your shortened URL is the Base36 encoded ID.

查阅使用案例:

  • Create a shortened URL
    means in you implementation check whether you already have that URL in the table (simple, just return the Base36 encoded ID).
    Otherwise just create a new entry and return the Base36 encoding of the new ID.

  • Lookup the full URL
    Decode the Base36 value to an ID, lookup the ID in the table and return -if found- the full URL.

因此,基本上,你创造了一种双轨功能(双向1:1:1信),只是两个方向都奏效而没有任何损失,从而完全无法解释贵表格中给出的URLs。 该基地36 编码/编码也是完全不可逆的,因此是一种双管功能:

www.un.org/Depts/DGACM/index_french.htm 如果你提到的话,那将是一个内流(改写)的好基础,这样你就可以尽可能避免非银圆。 www.un.org/Depts/DGACM/index_french.htm 而对于能够用多管线进入的海滩,我强烈建议使用<条码>目前使用<<<>代码>。 在您的情形下,并不需要“List<> part from Jon s implementation,因为你总是有1:1 correspondence。 更快速的看管,你可以把编码价值作为关键......

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签