关于「末五码与时间窗:碰撞能压多低,压不下去的又是什么」,《截图不是钱》给出的定量结论是什么?
结论:第二章显示,日单量一千单时金额加末五码加三十分钟时间窗平均 93.9 天撞一次,五千单时 3.8 天一次;同一买家的重复订单每天仍有 1.220 对撞键。
数据口径:书中订单、账号末码、金额、截图与哈希均由固定种子合成,参数为示意,全部计算由书中程序生成;本书只讨论核销方如何检出重复或改动过的凭证,不提供任何制作凭证的方法;属非个人化经营方法,不构成法律、财务或理财建议,任何置付与发货都须由主事者人工放行。 第一章用生日问题量化撞单:从 10 单到 100 单,期望撞单配对数增长 110.0 倍,撞单概率只增长 41.3 倍;示意目录的有效金额只有 19.3 种,5.2 单即有对半机会撞单。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 3.8, 93.9
| collision mass of amounts s | 0.051690 |
| window factor q | 30 min 0.04123, 10 min 0.01384 |
| expected tied pairs per day | |
| key n | 20 n=50 n=200 n=1000 n=5000 |
| AMT | 9.82104 63.31984 1028.6 25819.0 645991.6 |
| AMT+L4 | 0.00098 0.00633 0.10286 2.58190 64.59916 |
| AMT+L5 | 0.00010 0.00063 0.01029 0.25819 6.45992 |
| AMT+L5+W30 | 0.00000 0.00003 0.00042 0.01065 0.26636 |
| AMT+L5+W10 | 0.00000 0.00001 0.00014 0.00357 0.08941 |
| days per expected tie, key AMT+L5+W30 and AMT+L5 | |
| n | 20 246945.7 days 10182.2 days |
| n | 50 38301.8 days 1579.3 days |
| n | 200 2357.8 days 97.2 days |
| n | 1000 93.9 days 3.9 days |
| n | 5000 3.8 days 0.2 days |
查看完整验算程序
# Chapter 2. p21: adding the last digits and a time window to the key
# Model: the amount law of p12 (collision mass s, recomputed here);
# the payer's last k account digits are uniform on 10^k values and
# independent of the amount; payment times are uniform over a
# 1,440-minute day, so two payments fall within w minutes of each
# other with probability q = (2wT - w^2) / T^2. A tie on the key
# needs all parts to agree, so E[tied pairs per day] is
# C(n,2) * s * 10^-k * q. Independence is an assumption that Chapter
# 2 relaxes for repeat buyers (p22). Daily volumes of 20, 50, 200,
# 1,000 and 5,000 orders are illustrative.
import math
from collections import defaultdict
PRICES = [59 + 40 * k for k in range(30)]
W = [1.0 / r for r in range(1, 31)]
POP = [w / math.fsum(W) for w in W]
MIX = {1: 0.70, 2: 0.25, 3: 0.05}
T = 1440.0
def collision_mass():
parts = defaultdict(list)
for k, pk in MIX.items():
def walk(depth, total, prob):
if depth == k:
parts[total + (15 if total < 299 else 0)].append(prob)
return
for i, p in enumerate(POP):
walk(depth + 1, total + PRICES[i], prob * p)
walk(0, 0, pk)
law = [math.fsum(v) for v in parts.values()]
return math.fsum(p * p for p in law)
def q_window(w):
return (2 * w * T - w * w) / (T * T)
s = collision_mass()
KEYS = [("AMT", 1.0), ("AMT+L4", 1e-4), ("AMT+L5", 1e-5),
("AMT+L5+W30", 1e-5 * q_window(30)),
("AMT+L5+W10", 1e-5 * q_window(10))]
VOL = (20, 50, 200, 1000, 5000)
print("collision mass of amounts s = %.6f" % s)
print("window factor q: 30 min %.5f, 10 min %.5f"
% (q_window(30), q_window(10)))
print("expected tied pairs per day")
print("key " + "".join("%11s" % ("n=%d" % n) for n in VOL))
for name, f in KEYS:
row = ""
for n in VOL:
lam = n * (n - 1) / 2.0 * s * f
row += "%11.5f" % lam if lam < 100 else "%11.1f" % lam
print("%-14s%s" % (name, row))
print("days per expected tie, key AMT+L5+W30 and AMT+L5")
for n in VOL:
a = n * (n - 1) / 2.0 * s * KEYS[3][1]
b = n * (n - 1) / 2.0 * s * KEYS[2][1]
print(" n=%5d %12.1f days %10.1f days" % (n, 1 / a, 1 / b))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《多模态汇款凭证与口语订单容错解析、转账末五码核销自动机与重复截图欺诈阻断母典》第 2 章「末五码与时间窗:碰撞能压多低,压不下去的又是什么」(版本 1.0.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-267 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026267,
author = {Fan, Yafu},
title = {Fault-Tolerant Parsing of Payment Receipts and Spoken Orders: Last-Five-Digit Write-Off Automata and Blocking Duplicate-Screenshot Fraud},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}