sqids hashids 的升级版

sqids 是hashids 的升级版,提供了不少新功能,但是与hashids是不兼容的

包含的特性

  • 生成短id
  • 方便编码以及解码
  • 自动生成id
  • 支持通过自定义大阮的字母生成id
  • 每个版本可以生成唯一的id
  • 支持blocklist

使用场景

  • 主键编码
  • 保存数据库查找
  • 临时登陆token

不适合的场景

  • 敏感数据
  • 用户ID

说明

sqids 提供了与hashids 不同的特性,但是提供的一些功能还是很不错的,值得尝试下

参考资料

https://www.npmjs.com/package/sqids
https://sqids.org/
https://sqids.org/faq

posted on   荣锋亮  阅读(69)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2022-05-21 spring 使用jsontemplate 处理rest 响应内容格式
2020-05-21 promgen prometheus 配置文件生成工具
2020-05-21 一些开源的数据查询语言
2019-05-21 ssh:no matching host key type found. Their offer: ssh-dss
2019-05-21 virtualenvwrapper 方便的virtualenv 包装
2018-05-21 spring boot 使用spring.resources.static-locations 分离系统模版&&资源文件
2018-05-21 Tencent Server Web 安装试用

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示