let body = Object.keys(params).sort().map(k => { return'<' + k + '>' + params[k] + '</' + k + '>' }).join('\n') body += '\n<sign>' + sign + '</sign>\n' const xml = '<xml>\n' + body + '</xml>' return xml }
// ----------- nonce_str functionmakeid(length) { var result = ''; var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; var charactersLength = characters.length; for ( var i = 0; i < length; i++ ) { result += characters.charAt(Math.floor(Math.random() * charactersLength)); } return result; }