Create a new Script instance
the buffer containing the data
the offset in the buffer to encode from
a function that indicates whether or not to send the new value instead of * the difference, depending on the byte cost.
A function that indicates whether or not to send the new value instead of the difference, depending on the byte cost.
The buffer containing the data
The CBOR encoder
If insertStart is not -1, there is an unflushed insert of insertLength bytes.
If matchStart is not -1, there is an unflushed/uncoalesced match of matchLength bytes. If insertStart is also not -1, the match follows the insert; they could not be coalesced, but that might change if the next insert is small.
The offset in the buffer to encode from
Close the script and flush all pending operations
a flag indicating success
Process a delete operation
the number of bytes of the delete
a flag indicating success
Flush all pending operations
a flag indicating success
Process an insert operation
the starting position of the insert
the number of bytes of the insert
a flag indicating success
Process a match operation
the number of bytes of the match
a flag indicating success
Write an insert to the encoder
a flag indicating success
Write a match to the encoder
a flag indicating success
Copyright © 2025 DiffusionData Ltd. All Rights Reserved.
A script for Myers Binary Diff algorithm to process the differences between two pieces of CBOR data