/**
 *
 * @param {Uint32Array|Int32Array} array
 * @param {number} offset
 * @param {number} length
 * @return {number}
 */
export function uint32_array_hash(array, offset, length) {
    let hash = length;

    for (let i = offset; i < length; ++i) {

        const channel_value = array[i];

        hash = ((hash << 5) - hash) + channel_value;

    }

    return hash;
}