Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Marou-Fer committed Mar 15, 2024
1 parent ef7ad74 commit 0c80a31
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
24 changes: 24 additions & 0 deletions SAC_Custom_Widgets/Sunbrust Chart with Styling Panel/build/sign.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const fs = require('fs')
const { createHash } = require('crypto')
const path = require('path')

const run = js => {
const hashSha256 = createHash('sha256')
const input = fs.createReadStream(path.join(__dirname, '../', js))
input.on('readable', () => {
const data = input.read()
if (data) {
hashSha256.update(data)
} else {
const integrity = `sha256-${hashSha256.digest('base64')}`
console.log(`${js}: ${integrity}`)
}
})
}

[
'main.js',
'styling.js'
].forEach(js => run(js))
// main.js: sha256-MeTdl0DMaTJcaQnYlp5Tf96vDT+pdAewY19VdbZOs4Q=
// styling.js: sha256-8AykY9bAoqb0rMOoG3kR6XtPhpLlmKLgIvznx/eeNio=
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
"kind": "main",
"tag": "com-sap-sample-init-example-echarts-sunburst",
"url": "/main.js",
"integrity": "",
"ignoreIntegrity": true
"integrity": "sha256-S45HecIhMOne4pYQI8ug/oPEoVfIPWV3dK8QT2xFqxE=",
"ignoreIntegrity": false
},
{
"kind": "styling",
"tag": "com-sap-sample-init-example-echarts-sunburst-styling",
"url": "/styling.js",
"integrity": "",
"ignoreIntegrity": true
"integrity": "sha256-PVC7vMUOwmuw4LdIx8CbBWR0USwlEDwpZeYvILkq1wo=",
"ignoreIntegrity": false
}
],
"properties": {
Expand Down

0 comments on commit 0c80a31

Please sign in to comment.