Module utils

Module utils 

Source
Expand description

Utility functions for testing, benchmarking, and batch operations

Structs§

BlockStatistics
Compute statistics for a collection of blocks

Functions§

compute_cid
Compute CID from raw data for testing/benchmarking
compute_total_size
Compute total size of a block collection
create_block
Create a block from raw data for testing
create_blocks_batch
Create multiple blocks from raw data efficiently
deduplicate_blocks
Deduplicate blocks by CID (keep first occurrence)
estimate_compression_ratio
Estimate compression ratio for a block
extract_cids
Extract CIDs from a collection of blocks
filter_blocks_by_size
Filter blocks by size range
find_duplicates
Find duplicate blocks (same CID)
generate_compressible_blocks
Generate multiple compressible blocks for compression testing
generate_compressible_data
Generate compressible data for testing compression
generate_dedup_dataset
Create blocks with controlled deduplication characteristics
generate_incompressible_data
Generate incompressible data for testing
generate_mixed_size_blocks
Create a test dataset with mixed block sizes
generate_pattern_blocks
Generate blocks with specific patterns for testing
generate_random_block
Generate random block data for testing
generate_random_blocks
Generate multiple random blocks with sequential seeds
group_blocks_by_size
Group blocks by size ranges for analysis
sample_blocks
Sample a subset of blocks for testing
sort_blocks_by_size_asc
Sort blocks by size (ascending)
sort_blocks_by_size_desc
Sort blocks by size (descending)
validate_block_integrity
Validate block integrity by recomputing CID
validate_blocks_batch
Batch validate block integrity for multiple blocks