Expand description
通用工具:UUID v7、SHA-256、时间与命名判定。
Constants§
- CACHE_
DIR - 派生缓存目录(可删、建议 gitignore)。
- LOCK_
FILE - 短期写入锁文件名。
- META_
FILE - 元数据文件名。
- SCHEMA_
DIR - bundle 级 Schema 目录。
Functions§
- hex
- 字节数组 → 小写十六进制。
- is_
lock_ file - 是否为
.lock。 - is_
meta_ file - 是否为
._meta。 - is_
os_ noise - 是否为操作系统 / 工具元数据:一律豁免,不参与校验(规范 3.4)。
- is_
other_ dotfile - 是否为其它点文件(非
._meta/.lock)→W_DOTFILE。 - is_
reserved_ name - 是否为格式保留名(以
._开头)。 - is_
sub_ bundle - 是否为独立子 bundle:目录名以
.str结尾。 - is_uuid
- 是否为合法 UUID 字面量。
- new_
uuid - 按
policies.id_version生成新 id:4→ UUIDv4,其余(含7)→ UUIDv7。 - new_
uuid_ v7 - 生成 UUID v7(时间有序)。
- now_
rfc3339 - 当前 UTC 时间,RFC3339 形式(统一
+00:00偏移)。 - parse_
rfc3339 - 解析 RFC3339(offset date-time)。
- rel_
display - 便捷:路径显示为 bundle 内相对路径。
- relative_
depth dir相对root的深度(ROOT 自身为 0)。- sha256_
bytes - 计算字节串 SHA-256。
- sha256_
file - 计算文件 SHA-256。
- uuid_
version - 解析 UUID,返回版本号。