slice = function slice(blob, start, end) {

        // Use prefixed implementations if necessary
        var sliceImplementation = (
                blob.slice
             || blob.webkitSlice
             || blob.mozSlice
        ).bind(blob);

        var length = end - start;

        // The old Blob.slice() was length-based (not end-based). Try the
        // length version first, if the two calls are not equivalent.
        if (length !== end) {

            // If the result of the slice() call matches the expected length,
            // trust that result. It must be correct.
            var sliceResult = sliceImplementation(start, length);
            if (sliceResult.size === length)
                return sliceResult;

        }

        // Otherwise, use the most-recent standard: end-based slice()
        return sliceImplementation(start, end);

    }
Browser-independent implementation of Blob.slice() which uses an end
offset to determine the span of the resulting slice, rather than a
length.

@private
@param {Blob} blob
    The Blob to slice.

@param {Number} start
    The starting offset of the slice, in bytes, inclusive.

@param {Number} end
    The ending offset of the slice, in bytes, exclusive.

@returns {Blob}
    A Blob containing the data within the given Blob starting at
    <code>start</code> and ending at <code>end - 1</code>.