DeepSeek Harness 插件

dsh-checkdigit

Check-digit mathematics toolbox for DeepSeek Harness (dsh): generate, validate and detect check digits for Luhn, Verhoeff, Damm, ISBN-10/13, EAN-8/13, UPC-A, ISIN, CUSIP and IBAN — zero runtime(英文原文)

跳到安装方式

来源信息

GitHub 仓库
TYEclipse/dsh-checkdigit
最近更新
2026年8月20日
分类
工具与能力
GitHub stars
1
载体类型
plugin
目录证据
上游声明已找到 dsh.bundle
证据路径
package.json#dsh.bundle
核对版本
0.1.0-rc.8
上游核对日期
2026-08-20

该证据由上游目录提供。本站没有安装、运行或安全审核这个插件。

安装

默认先复制一段 Prompt,让 Agent 读 GitHub 仓库和源码;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读 GitHub 仓库和源码。

请先不要安装或执行任何命令。阅读这个插件的 GitHub 仓库、README 和关键源码,然后用清楚、直接的方式回答以下问题,帮助我判断它是否适合我的需求:

1. 这个插件是什么,解决什么问题;
2. 适合哪些用户和典型使用场景;
3. 安装后如何使用,并给出一个最小使用示例;
4. 有哪些已知限制,以及隐私、安全、兼容性或维护风险;
5. 给出“推荐 / 有条件推荐 / 不推荐”的明确建议和理由。

请区分仓库明确说明、根据源码推断和未知信息。证据不足时请明确说明,不要猜测或照抄 README。

GitHub:https://github.com/TYEclipse/dsh-checkdigit
插件名:dsh-checkdigit
作者:TYEclipse

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器3 个文件
README.md来源说明 · 只读预览

dsh-checkdigit

Check-digit mathematics toolbox for DeepSeek Harness (dsh): generate, validate and detect check digits for 11 schemes — Luhn, Verhoeff, Damm, ISBN-10, ISBN-13, EAN-8, EAN-13, UPC-A, ISIN, CUSIP and IBAN.

> 校验位数学工具箱:生成 / 验证 / 识别 11 种校验位(Luhn、Verhoeff、Damm、ISBN、EAN、UPC、ISIN、CUSIP、IBAN),零运行时依赖、纯本地算术。

Why

Language models routinely botch check-digit arithmetic: wrong card-number checksums, ISBNs that fail validation, IBANs with impossible check digits. Every algorithm here is implemented from its published specification with pure integer arithmetic — deterministic, offline, zero runtime dependencies — and cross-checked against published worked examples (Apple's US0378331005, the classic GB82 WEST 1234 5698 7654 32, the Luhn textbook example 79927398713, and more).

Install

dsh plugin --profile web add github:TYEclipse/dsh-checkdigit

Then add dsh-checkdigit to dsh.profile.bundles in your profile's package.json if it is not auto-activated, and restart dsh.

Tools

checkdigit_generate

Compute the check digit for a payload and return the complete identifier.

checkdigit_generate(scheme="luhn", payload="7992739871")
→ checkDigit: "3", complete: "79927398713"

Supported scheme values and their payloads:

schemepayloadcheck digitexample complete
luhndigits (any length ≥ 1)last digit79927398713
verhoeffdigits (any length ≥ 1)last digit2363
dammdigits (any length ≥ 1)last digit5724
isbn109 digits10th char (0-9 or X)0306406152
isbn1312 digits13th digit9780306406157
ean87 digits8th digit96385074
ean1312 digits13th digit4006381333931
upca11 digits12th digit036000291452
isin2 letters + 9 alphanumerics12th char (digit)US0378331005
cusip8 chars from [A-Z0-9*@#]9th char (digit)037833100
iban2-letter country + BBANchars 3–4 (two digits)GB82WEST12345698765432

Use it to build test card numbers, ISBNs, barcodes, securities identifiers or account numbers whose check digits actually verify.

checkdigit_validate

Verify the check digit of a full identifier. The scheme is auto-detected when omitted (ISIN → CUSIP → IBAN → EAN-13 → UPC-A → EAN-8 → ISBN-10 → Luhn); pass scheme to force one.

checkdigit_validate(value="GB82WEST12345698765432")
→ valid: true, scheme: "iban", iban.country: "GB", iban.formatted: "GB82 WEST 1234 5698 7654 32"

checkdigit_validate(value="79927398714")
→ valid: false, scheme: "luhn", checkDigit: "4", expected: "3",
  detail: "Luhn: check digit should be 3, but the value ends in 4"

Spaces and dashes in the input are ignored. When a value is invalid, the result carries the expected check digit so callers can fix it programmatically.

checkdigit_info

Describe the supported schemes: identifier lengths, payload formats, check-digit positions and worked examples. Call with a scheme for one scheme, or without arguments for all 11.

Supported schemes

SchemeStandardDetail
LuhnISO/IEC 7812Credit/debit cards, IMEI, loyalty cards
VerhoeffDihedral-group checksum; catches all single errors and adjacent transpositions
DammQuasigroup operation; full-value tally must be zero
ISBN-10ISO 2108Mod-11; check digit may be X (= 10)
ISBN-13ISO 2108EAN-13 arithmetic (Bookland)
EAN-8 / EAN-13GS1 GTIN-8 / GTIN-13Retail barcodes
UPC-AGS1 GTIN-12North American retail barcodes
ISINISO 6166Securities; letters expand A=10…Z=35, then Luhn
CUSIPANSI X9.6North American securities; * @ # allowed; even positions doubled
IBANISO 13616Mod-97 over letter-expanded rearranged string; BBAN length table for 75+ countries

Development

pnpm install
pnpm build
pnpm test   # 51 tests, anchors cross-checked against published worked examples
pnpm lint

License

MIT