Search Ctrl K
Home / Tools
THE FEUTEX TOOLKIT

Circular Buffer Wrap Plan

Map a monotonic sequence number to a ring slot and estimate fixed storage.

Developer workspace● Runs in your browser
01 Your input
02 Your result
View or copy raw result data
FormulaZero-based slot index = sequence%capacity; Completed wraps = Math.floor(sequence/capacity); Ring payload memory = capacity*bytes/1024

Made for real tasks

  • Map a monotonic sequence number to a ring slot and estimate fixed storage.
Explore step-by-step workflows →

Worked example

Inputs

Ring capacity
1024 slots
Sequence number
100000 index
Bytes per slot
64 bytes

Expected results

Zero-based slot index
672 index
Completed wraps
97 wraps
Ring payload memory
64 KiB

Load the example in the workspace to reproduce these results. Display rounding does not change the underlying calculation.

How to use this tool

  1. Enter ring capacity, sequence number, bytes per slot in the displayed units.
  2. Calculate the scenario, then compare it with measurements before changing a system.

Try this example

{
  "capacity": 1024,
  "sequence": 100000,
  "bytes": 64
}

Accuracy and scope

Zero-based unsigned sequence; concurrency synchronization and producer-consumer fullness are not modeled.

Is my data uploaded?

This tool runs locally in your browser. Input and output are not sent to a processing server. Copy or download your result before leaving the page.