샘플
miniz_oxide 0.8.9: miniz_oxide::deflate::CompressionLevel
검증된 샘플 — cargo miniz_oxide 0.8.9: miniz_oxide::deflate::CompressionLevel. rust 1 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다.
sha256:3e243fe6715cbf27f09c56d57040ca0fdc6daf3a4ac147ca1cbae75ac2e258c6
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 1
- 빌드한 서명 키
- 1
선언된 환경
linux x64 cargo
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| rust 1 · linux alpine/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · cargo@1rust:1-alpine@sha256:a10e64dd139b… |
2026-09-20 |
케이스
HOW- 목표
- verify miniz_oxide::deflate::CompressionLevel in pkg:cargo/miniz_oxide@0.8.9
- 심벌
-
- miniz_oxide::deflate::CompressionLevel
- 생성일
- 2026-09-20T19:58:38Z
컨트랙트
- CompressionLevel variants map to expected integer deflate levels including NoCompression, BestSpeed, DefaultLevel, BestCompression, and UberCompression
- CompressionLevel supports Debug formatting and standard equality comparisons
- CompressionLevel supports cloning, copy semantics, and hashing for collection storage
- CompressorOxide accepts CompressionLevel configuration via set_compression_level
- Data compressed with CompressionLevel round-trips through decompress_to_vec back to the original bytes
파일
- Cargo.lock
- Cargo.toml
- PROMPT.md
- csx.json
- spec.json
- src/lib.rs
- test/contract.rs
소스
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "adler2"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
[[package]]
name = "miniz_oxide"
version = "0.8.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"
dependencies = [
"adler2",
]
[[package]]
name = "sample-miniz-oxide"
version = "1.0.0"
dependencies = [
"miniz_oxide",
]
[package]
name = "sample-miniz-oxide"
version = "1.0.0"
edition = "2021"
publish = false
[dependencies]
miniz_oxide = "=0.8.9"
[[bin]]
name = "contract"
path = "test/contract.rs"
Clean-room public code sample — generation instructions
Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.
A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.
Goal: verify miniz_oxide::deflate::CompressionLevel in pkg:cargo/miniz_oxide@0.8.9
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:cargo/miniz_oxide@0.8.9
Demonstrate these symbols/APIs:
- miniz_oxide::deflate::CompressionLevel
Rules:
- One focused purpose; the smallest project that proves the goal.
- Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
- Pin every dependency with a lockfile so resolution is reproducible.
- No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
- No personal names, emails, company names, or project identifiers of any kind.
- No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
- Keep it under 200 files and 256KB packed.
{"case":{"caseId":"case:sha256:71e8fd6c4f798f1c0437e30d5153ece5560839a9203942f05c2a2fb61d3ab5bb","contract":["CompressionLevel variants map to expected integer deflate levels including NoCompression, BestSpeed, DefaultLevel, BestCompression, and UberCompression","CompressionLevel supports Debug formatting and standard equality comparisons","CompressionLevel supports cloning, copy semantics, and hashing for collection storage","CompressorOxide accepts CompressionLevel configuration via set_compression_level","Data compressed with CompressionLevel round-trips through decompress_to_vec back to the original bytes"],"goal":"verify miniz_oxide::deflate::CompressionLevel in pkg:cargo/miniz_oxide@0.8.9","kind":"HOW","packages":["pkg:cargo/miniz_oxide@0.8.9"],"schemaVersion":1,"symbols":["miniz_oxide::deflate::CompressionLevel"]},"contractCommand":["cargo","run","--offline"],"environment":{"arch":"x64","ecosystem":"cargo","os":"linux","packageManager":"cargo","schemaVersion":1},"license":"MIT-0","packages":["pkg:cargo/miniz_oxide@0.8.9"],"schemaVersion":1,"subject":"pkg:cargo/miniz_oxide@0.8.9","symbols":["miniz_oxide::deflate::CompressionLevel"],"verifierAdapter":"cargo@1"}
{
"schemaVersion": 1,
"goal": "verify miniz_oxide::deflate::CompressionLevel in pkg:cargo/miniz_oxide@0.8.9",
"kind": "HOW",
"packages": [
"pkg:cargo/miniz_oxide@0.8.9"
],
"symbols": [
"miniz_oxide::deflate::CompressionLevel"
]
}
//! Clean-room verification sample for miniz_oxide.
pub use miniz_oxide::*;
use miniz_oxide::deflate::core::CompressorOxide;
use miniz_oxide::deflate::{compress_to_vec, CompressionLevel};
use miniz_oxide::inflate::decompress_to_vec;
use std::collections::HashSet;
fn main() {
// 1. CompressionLevel variants map to expected integer deflate levels including NoCompression, BestSpeed, DefaultLevel, BestCompression, and UberCompression
assert_eq!(CompressionLevel::NoCompression as i32, 0);
assert_eq!(CompressionLevel::BestSpeed as i32, 1);
assert_eq!(CompressionLevel::DefaultLevel as i32, 6);
assert_eq!(CompressionLevel::BestCompression as i32, 9);
assert_eq!(CompressionLevel::UberCompression as i32, 10);
assert_eq!(CompressionLevel::DefaultCompression as i32, -1);
// 2. CompressionLevel supports Debug formatting and standard equality comparisons
assert_eq!(format!("{:?}", CompressionLevel::BestSpeed), "BestSpeed");
assert_eq!(format!("{:?}", CompressionLevel::NoCompression), "NoCompression");
assert_eq!(CompressionLevel::BestSpeed, CompressionLevel::BestSpeed);
assert_ne!(CompressionLevel::BestSpeed, CompressionLevel::BestCompression);
// 3. CompressionLevel supports cloning, copy semantics, and hashing for collection storage
let level_copy = CompressionLevel::DefaultLevel;
let mut level_set = HashSet::new();
level_set.insert(level_copy);
level_set.insert(CompressionLevel::DefaultLevel);
level_set.insert(CompressionLevel::UberCompression);
assert_eq!(level_set.len(), 2);
assert!(level_set.contains(&level_copy));
// 4. CompressorOxide accepts CompressionLevel configuration via set_compression_level
let mut compressor = CompressorOxide::default();
compressor.set_compression_level(CompressionLevel::BestSpeed);
compressor.set_compression_level(CompressionLevel::BestCompression);
compressor.set_compression_level(CompressionLevel::NoCompression);
// 5. Data compressed with CompressionLevel round-trips through decompress_to_vec back to the original bytes
let payload = b"miniz_oxide clean-room contract verification test for CompressionLevel. Data repetition test 1234567890 1234567890.";
let levels = [
CompressionLevel::NoCompression,
CompressionLevel::BestSpeed,
CompressionLevel::DefaultLevel,
CompressionLevel::BestCompression,
CompressionLevel::UberCompression,
];
for level in levels {
let compressed = compress_to_vec(payload, level as u8);
let decompressed = decompress_to_vec(&compressed).expect("decompression succeeds");
assert_eq!(decompressed, payload);
}
// Verify compression ratio differences between NoCompression and BestCompression
let compressed_none = compress_to_vec(payload, CompressionLevel::NoCompression as u8);
let compressed_best = compress_to_vec(payload, CompressionLevel::BestCompression as u8);
assert!(compressed_best.len() < compressed_none.len());
println!("All miniz_oxide::deflate::CompressionLevel contract assertions passed successfully.");
}
오리진 시더
익명