skipList
@twine-protocol/twine-core v0.1.0 • Docs
twine-js / @twine-protocol/twine-core / skipList
Function: skipList()
skipList(
radix
,fromIndex
,toIndex
,byLink
):Generator
<number
,void
,unknown
>
Get an iterator of indices that can be used to skip through the chain.
This can either provide the pulse indices themselves or a list of array indices of the links list for each pulse along the path.
This will not include the from/to indices themselves.
A radix of 1 doesn't make sense since 1^r
is always 1
.
A radix of 0 is interpreted as no radix skipping, so the list just has the previous pulse cid, therefore a radix 0 skiplist is just a decreasing list of pulse indices.
Parameters
radix
number
undefined
The radix used for the chain
fromIndex
number
undefined
The higher index
toIndex
number
undefined
The lower index
byLink
boolean
false
If true, will return the list of array indices for the links list
Returns
Generator
<number
, void
, unknown
>
Example
Defined in
Last updated