A production-grade software supply chain security, multi-base codec and Merkle tree verification toolkit in MoonBit.
| 路径 | 作用 |
|---|---|
| top.mbt | 面向使用者的顶层门面 API |
| lib/codec | 编码、解码和 Multibase 内容标识 |
| lib/digest | 快速指纹、密码学摘要和恒时比较 |
| lib/merkle | Merkle 树、包含证明和发布前自检 |
| lib/manifest | 文件清单、差异、结构审计和依赖政策 |
| cmd/cli | 可直接运行的工作流演示 |
| .github/workflows/test.yml | Linux/macOS/Windows CI 质量门禁 |
moon version --all
moon check --deny-warn
moon test --deny-warn
moon fmt --check
moon info
moon run cmd/cli// In a package importing wch6766/MoonSecureCodec/lib/manifest:
let artifact : Bytes = b"release artifact bytes"
let file = @manifest.FileSnapshot::from_bytes("dist/app.bin", artifact)
let manifest = @manifest.Manifest::new(
"example-app",
"1.2.3",
"2026-08-12T00:00:00Z",
[file],
)
let report = manifest.audit_with_policy([".bin"], 50_000_000L)
if report.has_errors() {
println(report.to_text())
}// Each record should be populated from the reviewed dependency lock data.
let dependencies : Array[@manifest.Dependency] = [
{
name: "moonbitlang/core",
version: "0.10.3",
license: "Apache-2.0",
source: "https://github.com/moonbitlang/core",
digest: "0123456789abcdef0123456789abcdef",
},
]
let policy = @manifest.LicensePolicy::strict(["Apache-2.0", "MIT"])
let result = @manifest.audit_dependencies(dependencies, policy)
assert_false(result.has_errors())fn sha256_hex(data : Bytes) -> Stringfn to_base64(data : Bytes, url_safe? : Bool) -> Stringfn xxhash64(data : Bytes) -> UInt64A production-grade software supply chain security, multi-base codec and Merkle tree verification toolkit in MoonBit.