nodejs-hash_file/deprecated-md4-function.patch

59 lines
1.8 KiB
Diff

From 5f9eb49ab02822c3f8dd9012b41dd74ec1e2cb17 Mon Sep 17 00:00:00 2001
From: wang--ge <wang__ge@126.com>
Date: Fri, 10 Feb 2023 14:50:01 +0800
Subject: [PATCH] deprecated md4 function
---
test/test.js | 35 -----------------------------------
1 file changed, 35 deletions(-)
diff --git a/test/test.js b/test/test.js
index 4c99a4d..51c40bc 100644
--- a/test/test.js
+++ b/test/test.js
@@ -33,41 +33,6 @@ describe('hash_file module', function(){
fs.unlink(filePath, done)
})
- describe('md4', function() {
- it('should generate a md4 hash without error', function(done){
- console.time('md4')
- hash_file(filePath, 'md4', function(err, hash) {
- console.timeEnd('md4')
- assert.ok(!err, err)
- assert.ok(hash)
- assert.equal(32, hash.length)
- done()
- })
- })
- it('should generate the same md4 hash multiple times for the same file', function(done) {
- hash_file(filePath, 'md4', function(err, hash_first) {
- assert.ok(!err, err)
- hash_file(filePath, 'md4', function(err, hash_second) {
- assert.ok(!err, err)
- assert.equal(hash_first, hash_second)
- done()
- })
- })
- })
- it('should generate a different hash for a modified file', function(done) {
- hash_file(filePath, 'md4', function(err, hash_first) {
- assert.ok(!err, err)
- fs.writeFile(filePath, 'md4 data', function(err) {
- assert.ok(!err, err)
- hash_file(filePath, 'md4', function(err, hash_second) {
- assert.ok(!err, err)
- assert.notEqual(hash_first, hash_second)
- done()
- })
- })
- })
- })
- })
describe('md5', function() {
it('should generate a md5 hash without error', function(done){
console.time('md5')
--
2.27.0