From 728de15f048533ac98c4f6940033f3f7f3e72661 Mon Sep 17 00:00:00 2001 From: s50600822 Date: Thu, 8 Feb 2024 12:30:32 +1100 Subject: [PATCH] n17 --- vs/node/README.md | 5 +++++ vs/node/hash.js | 15 +++++++++++++++ vs/node/n16_fine.sh | 7 +++++++ vs/node/n17_broken.sh | 7 +++++++ 4 files changed, 34 insertions(+) create mode 100644 vs/node/README.md create mode 100644 vs/node/hash.js create mode 100755 vs/node/n16_fine.sh create mode 100755 vs/node/n17_broken.sh diff --git a/vs/node/README.md b/vs/node/README.md new file mode 100644 index 00000000..63deb0dc --- /dev/null +++ b/vs/node/README.md @@ -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 diff --git a/vs/node/hash.js b/vs/node/hash.js new file mode 100644 index 00000000..0ef14f06 --- /dev/null +++ b/vs/node/hash.js @@ -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); diff --git a/vs/node/n16_fine.sh b/vs/node/n16_fine.sh new file mode 100755 index 00000000..109c5d11 --- /dev/null +++ b/vs/node/n16_fine.sh @@ -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 \ No newline at end of file diff --git a/vs/node/n17_broken.sh b/vs/node/n17_broken.sh new file mode 100755 index 00000000..f8f5fb73 --- /dev/null +++ b/vs/node/n17_broken.sh @@ -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 \ No newline at end of file