创建尽可能短的不区分大小写验证码 [英] Creating the shortest possible case-insensitive verification number

查看:250
本文介绍了创建尽可能短的不区分大小写验证码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这将是有点长和rambly,但我想,以确保一切都在适当的范围内。

This is going to be a little long and rambly, but I want to make sure everything is in the proper context.

早在2004年,我用传统的ASP和VBScript写了一个在线学习管理系统。我现在工作的一些升级(并定期问自己WTF当我写code ...的各个环节我的想法),我想借此机会来解决频繁投诉我得到之一 - 验证号码的大小

Back in 2004 I wrote an online Learning Management System using Classic ASP and VBScript. I'm now working on some upgrades (and periodically asking myself WTF I was thinking when I wrote various segments of code...), and I want to take this opportunity to resolve one of the frequent complaints I get - the size of the verification numbers.

当你完成一个在线测试,将显示一个验证码,所以如果你需要重新创建你的结业证书(其医院,并试图让他们摆脱他们的论文的,好像叫林纳斯放弃他的毯子),您可以输入号码,等等等等。

When you complete a test online, a verification number is displayed so if you needed to re-create your certificate of completion (its a hospital, and trying to get them to get rid of their paper is like asking Linus to give up his blanket) you can enter the number, etc. etc.

在我写的(和可悲的是仍然这一天)的时候没有唯一标识符我可以用它来创建一个页面成绩单 - 所以请不要发布建议,以实现这一目标。还有更多事情比我想进入,我想阻止我不能使用有效的建议。 ;)

At the time I wrote it (and sadly still to this day) there is no unique identifier I can use to create a transcript page - so please don't post suggestions to that end. There's more going on than I care to get into, and I want to head off valid suggestions that I can't use. ;)

验证号码是各种信息的连接(主要是因为当我第一次写的我是白痴福利局,所以是不在身边),虽然它是一个非常-AP preciated功能有一个关于数字多久投诉很多。在这一点上返回原始ID是再好不过的,因为我们是在6位数范围。

The verification number is a concatenation of various pieces of information (mostly because when I first wrote it I was an idiot newb and SO wasn't around), and while it is a much-appreciated feature there are a lot of complaints about how long the number is. Returning the raw ID at this point is no better as we're in the 6-digit range.

我最初的想法是使用Base64编码算法我从别处得到的,但考虑到我已经受够了只是数字,我想将其更改为一个区分大小写的值的问题,只要求一个不同类问题...这使我的问题在眼前:

My initial idea was to use a Base64 encoding algorithm I got from elsewhere, but given the problems I've had with just numbers, I'm thinking changing it to a case-sensitive value is only asking for a different class of problems... which brings me to the question at hand:

我可以用它来创建尽可能短的不区分大小写的验证号码,因为六角不会减少长度AP preciably?

What can I use to create the shortest possible case-insensitive verification number since hex won't reduce the length appreciably?

和作为标签显示,我需要能够实现它在ASP经典/ VBScript中 - 迁移是不是在这一点上的一个选项

And as the tags indicate, I need to be able to implement it in ASP Classic/VBScript - migration is not an option at this point.

编辑:的基础上的答案,我找到了一个链接到Crockfor的实现Base32的,它看起来像什么,我正在寻找 - 的 http://www.crockford.com/wrmg/base32.html

based on the answers, I found a link to Crockfor's implementation of Base32, which looks like what I'm looking for - http://www.crockford.com/wrmg/base32.html

推荐答案

Base36

修改:那么幸运在评论中提到,使用Base36可能不会给任何真正的优势的 Base32 在这种情况下。

Edit: As Lucky mentions in the comments, using Base36 probably doesn't give any real advantage over Base32 in this situation.

这篇关于创建尽可能短的不区分大小写验证码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆