Blyx Nest Blyx language
Registry / Library
library · v0.1.0

BlockSpan

Expand a byte request to whole storage blocks.

Source repository · Package JSON

Use BlockSpan

use vendor::blockspan::blockspan;

Run the example

nest demo blockspan@0.1.0
blyxc native-run blockspan-demo/main.blyx
Example source and expected output
use vendor::blockspan::blockspan;

fn main() {
    let offset = 7.0;
    let length = 4.0;
    let block = 8.0;
    let result = blockspan_align(offset, length, block);
    if len(result) == 0 { println!("invalid"); return; }
    let mut i = 0;
    while i < len(result) {
        println!(at(result, i));
        i += 1;
    }
}

Expected output

0
16
7

Published versions

VersionPackageSource commitSHA-256
0.1.0Download ZIP713d0a9be10067955276c44709c497544bfec41caa1d5566edf3f977168a2e7d88313fcbcf