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