如何针对 sql server 08 中的 Id 列使用基数 36 跳过粗俗单词?

发布于 2024-07-29 01:59:13 字数 182 浏览 2 评论 0原文

我需要尽可能短的 ID,所以我认为 base-36 非常适合这个。 我的想法是,我将使用自动递增的 Id 字段作为主键,然后创建一个基于 36 的用户 ID。 不幸的是,我不可避免地会遇到很多粗俗的单词组合。 我很难找到解决此问题的最佳方法,因为可疑单词可能是任何字符串组合。

有什么想法吗?

谢谢

I need the shortest possible Ids so I figure base-36 would work wonderful for this. The thought is I'll just use an auto-incrementing Id field as the primary key and then create a base-36 userid. Unfortunately I'll inevitably run into a lot of vulgar word combinations. I'm having a hard time wrapping my head around the best approach to solve this because the suspect word could be in any combination of strings.

Any thoughts?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

瞎闹 2024-08-05 01:59:13

您可以从选择的数字中省略元音(使用基数 31 或添加更多字符以使其恢复到 32 或 36 或其他)。

如果您的系统可以区分大小写,那么您可以使用大写和小写字母来扩展数字范围。 您指出长度很重要,因此这可能是一种有用的方法。

You could omit vowels from your selection of digits (either using base 31 or adding some more characters to bring it back up to 32 or 36 or whatever).

If your system can handle being case sensitive, then you can use both upper and lower case letters to extend your range of digits. You indicated that length is important, so this might be a useful approach.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文