Skip to content

Commit

Permalink
n17
Browse files Browse the repository at this point in the history
  • Loading branch information
s50600822 committed Feb 8, 2024
1 parent 07893eb commit 728de15
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
5 changes: 5 additions & 0 deletions vs/node/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### REF
https://www.reddit.com/r/webdev/comments/qd14bm/node_17_currently_breaks_most_webpack/
https://webpack.js.org/plugins/hashed-module-ids-plugin/
https://github.com/angular/angular-cli/issues/1656
https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported
15 changes: 15 additions & 0 deletions vs/node/hash.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const crypto = require('crypto');

function generateHash(data, algo) {
const hash = crypto.createHash(algo);
hash.update(data);
const hashedData = hash.digest('hex');

return hashedData;
}

const testData = 'Hello, World!';
const hashedData = generateHash(testData, "md4");//"md5", "sha256", "sha512" ... are fine.

console.log('Original Data:', testData);
console.log('Hash:', hashedData);
7 changes: 7 additions & 0 deletions vs/node/n16_fine.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
NODE_VERSION=v16.20.2

source /Users/hoaphan/.nvm/nvm.sh
nvm install $NODE_VERSION
nvm use $NODE_VERSION

node hash.js
7 changes: 7 additions & 0 deletions vs/node/n17_broken.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
NODE_VERSION=v17.0.0

source /Users/hoaphan/.nvm/nvm.sh
nvm install $NODE_VERSION
nvm use $NODE_VERSION

node hash.js

0 comments on commit 728de15

Please sign in to comment.