Skip to main content

level_of

Function level_of 

Source
pub const fn level_of(len: u64) -> u32
Expand description

The level of whole subtrees of len bytes: len is 1024 << level.

Requires a power of two of chunks. In a const, another size stops the build; elsewhere it panics.

ⓘ
use blake3_servil_core::throughput::level_of;
const PART: u64 = 5 << 20; // 5 MiB is no subtree's size
const LEVEL: u32 = level_of(PART);
let _ = LEVEL;