import { sparse_typed_array_hash } from "../../../../core/collection/array/typed/sparse_typed_array_hash.js";

/**
 *
 * @param {THREE.BufferAttribute} attribute
 * @returns {number}
 */
export function computeBufferAttributeHash(attribute) {
    let result = 0;

    if (attribute !== null) {
        const data = attribute.array;
        const data_size = data.length;

        result += data_size;

        result ^= sparse_typed_array_hash(data, 0, data_size);

    }

    return result;
}


