function encodeDeltas(numbers, stride, factor) {
  factor = factor ? factor : 1e5;
  let d;

  const lastNumbers = new Array(stride);
  for (d = 0; d < stride; ++d) {
    lastNumbers[d] = 0;
  }

  for (let i = 0, ii = numbers.length; i < ii; ) {
    for (d = 0; d < stride; ++d, ++i) {
      const num = numbers[i];
      const delta = num - lastNumbers[d];
      lastNumbers[d] = num;

      numbers[i] = delta;
    }
  }

  return encodeFloats(numbers, factor);
}
Encode a list of n-dimensional points and return an encoded string

Attention: This function will modify the passed array!

@param {Array<number>} numbers A list of n-dimensional points.
@param {number} stride The number of dimension of the points in the list.
@param {number} [factor] The factor by which the numbers will be
    multiplied. The remaining decimal places will get rounded away.
    Default is `1e5`.
@return {string} The encoded string.
@api