npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@15ms/shikiid

v0.1.0

Published

A compact parameterized identifier encoder.

Readme

@15ms/shikiid

紧凑的参数化标识编码器。

特性

  1. 时间有序,字典序即时间序,B-tree 索引天然友好
  2. 无状态生成,不依赖中心化服务,不注册节点,拿来即用
  3. URL 安全,base36 字符集(0-9a-z),大小写不敏感
  4. 紧凑可控,10 位起步,适配 varchar(20),参数化调节精度与容量

快速开始

import { ShikiIDGen } from '@15ms/shikiid';

const gen = new ShikiIDGen({ t: 4, c: 2, r: 4, tspan: 1800 });

gen.nextID();                              // "0a1b00x7k2"
gen.nextID();                              // "0a1b01m3p9"
gen.nextID({ time: 100, count: 0 });       // 指定时间桶和计数器
gen.nextID({ random: 'abcdef01' });        // 指定随机片段

Shiki(t, c, r) 格式

| 段 | 位数 | 用途 | |----|------|------| | 时间 | t (4–6) | 桶编码的创建时间戳 | | 计数 | c (2–4) | 进程内自增轮转计数器 | | 随机 | r (4–14) | 密码学安全随机后缀 |

配置参数

| 参数 | 类型 | 说明 | |------|------|------| | t | number | 时间编码位数(4–6) | | c | number | 自增轮转位数(2–4) | | r | number | 随机片段位数(4–14) | | tspan | number | 时间桶距(秒) | | epoch | Date? | 纪元起点(默认 2025-01-01) |

预设配置

| 配置 | 时间桶距 | 寿命 | 总长 | |------|---------|------|------| | Shiki(4,2,4) | 1800s (~30分钟) | ~96 年 | 10 | | Shiki(4,2,6) | 3600s (~1小时) | ~191 年 | 12 | | Shiki(6,2,12) | 10s | ~690 年 | 20 |

寿命 = tspan × 36^t,由外部根据业务需求计算后传入 tspan

碰撞率

以 Shiki(4,2,4)、tspan=1800s(30 分钟桶距)、1296 个 count 分组为例:

| 每桶 ID 数 | 碰撞率 | |-----------|--------| | 1,000 | ~10⁻⁷ | | 10,000 | ~0.002% | | 100,000 | ~0.18% |