---
# System prepended metadata

title: Untitled

---

const crypto = require('crypto-js')

/**
 * Builds a SHA256-hash by connecting all key and value pairs
 * @param {Object} properties The properties of a request to identify the model
 * @returns {String} The generated hash
 */
function generateSHA256(properties) {
    let connectedProperties = ''
    for (const property in properties)
        connectedProperties += `${properties[property].PROPERTY_NAME}${properties[property].PROPERTY_VALUE}`
    // predefined function SHA256
    // eslint-disable-next-line new-cap
    return `${crypto.SHA256(connectedProperties)}`
}


module.exports = {
    generateSHA256
}
