Skip to content

Commit e9bc45f

Browse files
committed
#129 Update wording of pathToRegion doc
1 parent 9ec6fbc commit e9bc45f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/smt/SparseMerkleTreePathUtils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ export function calculateCommonPath(path1: bigint, path2: bigint): CommonPath {
1515
}
1616

1717
/**
18-
* Region committed by an interior node (v6a): the node's `depth`-bit key prefix, packed into 32
19-
* bytes in the byte-order-preserving, LSB-in-byte convention. `path` is the absolute node/key path
20-
* (leading sentinel bit at `depth`); its low `depth` bits are the prefix. Bit `i` lives in byte
21-
* `⌊i/8⌋` least-significant-first, so the packing is little-endian.
18+
* Region committed by an interior node: the `depth`-bit common prefix of all leaves in the node's
19+
* sub-tree. The `i`th lowest bit of path will be the `i mod 8`th lowest bit in the `i div 8`th
20+
* byte of the returned 32-byte array (so the packing is little-endian); the remaining bits of the array
21+
* are set to zero.
2222
*/
2323
export function pathToRegion(path: bigint, depth: number): Uint8Array {
2424
const bits = path & ((1n << BigInt(depth)) - 1n);

0 commit comments

Comments
 (0)