Blyx Nest Blyx language
Registry / Framework
framework · v0.1.0

Swallow

Validate an exported payload's declared spans and checksum, then locate a byte.

Source repository · Package JSON

Use Swallow

use vendor::swallow::swallow;

Run the example

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

fn main() {
    let lengths = [1, 1];
    let payload = [65, 66];
    let offset = 1.0;
    let checksum = 12976260.0;
    let result = swallow_inspect(lengths, payload, offset, checksum);
    if len(result) == 0 { println!("invalid"); return; }
    let mut i = 0;
    while i < len(result) {
        println!(at(result, i));
        i += 1;
    }
}

Expected output

1
12976260
1
0

Published versions

VersionPackageSource commitSHA-256
0.1.0Download ZIP74d9702c0e1e36a0de333f62a331074e3ee5154f5a240a46d119a59419f54f6b3b12a54cba