Extending a fingerprint

The FP64 class provides methods for extending an existing fingerprint by more bytes or characters. This functionality is useful if the only change to the source data was appending a known series of bytes to the end of the original String data.

To produce a fingerprint equivalent to the fingerprint of the concatenation of two String objects, you can extend the fingerprint created from one String using another String. Given the two String variables s1 and s2, the following is true:

new FP64(s1 + s2).equals( new FP64(s1).extend(s2) )

The same logic is true for character arrays, not just String objects.

All operations for extending a fingerprint are destructive. The operations modify the fingerprint object directly, in place. All operations return the resulting FP64 object, so you can chain method calls together, such as in the following code:

new FP64("x").extend(foo).extend(92))

If you need to make a copy of a fingerprint, instantiate the FP64 object and use the FP64 object to copy as the constructor argument:

var original = new FP64("Hello world")
var copy = new FP64(original) // A duplicate of the original fingerprint