Skip to content

Commit af5aa92

Browse files
authored
Merge pull request #48 from CodeDead/release/2.1.2
Release/2.1.2
2 parents 151dbde + 2a41852 commit af5aa92

File tree

24 files changed

+378
-24
lines changed

24 files changed

+378
-24
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
![GitHub package.json version](https://img.shields.io/github/package-json/v/CodeDead/DeadHash-js)
66
![GitHub](https://img.shields.io/github/license/CodeDead/DeadHash-Js)
7-
![GitHub Releases (by Release)](https://img.shields.io/github/downloads/CodeDead/DeadHash-js/2.1.1/total)
7+
![GitHub Releases (by Release)](https://img.shields.io/github/downloads/CodeDead/DeadHash-js/2.1.2/total)
88

99
DeadHash is a free and open-source utility to calculate file and text hashes and checksums. The following calculations are supported:
1010

@@ -16,6 +16,10 @@ DeadHash is a free and open-source utility to calculate file and text hashes and
1616
* SHA-384
1717
* SHA-512
1818
* RIPEMD-160
19+
* CRC1
20+
* CRC8
21+
* CRC16
22+
* CRC24
1923
* CRC32
2024

2125
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app) and built using [Electron](https://electronjs.org/).

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "deadhash",
3-
"version": "2.1.1",
3+
"version": "2.1.2",
44
"description": "File and text hash calculator",
55
"homepage": "./",
66
"private": true,
@@ -71,7 +71,7 @@
7171
},
7272
"devDependencies": {
7373
"concurrently": "^5.3.0",
74-
"electron": "^11.2.2",
74+
"electron": "^11.2.3",
7575
"electron-builder": "^22.9.1",
7676
"eslint": "^7.19.0",
7777
"eslint-config-airbnb": "^18.2.1",

public/workers/FileWorker/index.html

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@
99
const ipcRenderer = window.require('electron').ipcRenderer;
1010
const fs = window.require('fs');
1111
const crypto = window.require('crypto');
12-
const crc32Calculator = require('crc').crc32;
12+
const crcCalculator = require('crc');
1313

14-
const fileHash = (filePath, md4, md5, sha1, sha224, sha256, sha384, sha512, ripemd160, crc32) => {
14+
const fileHash = (
15+
filePath, md4, md5, sha1, sha224, sha256, sha384, sha512, ripemd160,
16+
crc1, crc8, crc16, crc24, crc32,
17+
) => {
1518
return new Promise((resolve, reject) => {
1619
let MD4,
1720
MD5,
@@ -21,7 +24,11 @@
2124
SHA384,
2225
SHA512,
2326
RIPEMD160,
24-
crc32Checksum;
27+
crc1Checksum,
28+
crc8Checksum,
29+
crc16Checksum,
30+
crc24Checksum,
31+
crc32Checksum;
2532

2633
if (md4) MD4 = crypto.createHash('md4');
2734
if (md5) MD5 = crypto.createHash('md5');
@@ -32,7 +39,6 @@
3239
if (sha512) SHA512 = crypto.createHash('sha512');
3340
if (ripemd160) RIPEMD160 = crypto.createHash('ripemd160');
3441

35-
3642
try {
3743
const s = fs.createReadStream(filePath.toString());
3844

@@ -45,7 +51,11 @@
4551
if (sha384) SHA384.update(data);
4652
if (sha512) SHA512.update(data);
4753
if (ripemd160) RIPEMD160.update(data);
48-
if (crc32) crc32Checksum = crc32Calculator(data, crc32Checksum);
54+
if (crc1) crc1Checksum = crcCalculator.crc1(data, crc1Checksum);
55+
if (crc8) crc8Checksum = crcCalculator.crc8(data, crc8Checksum);
56+
if (crc16) crc16Checksum = crcCalculator.crc16(data, crc16Checksum);
57+
if (crc24) crc24Checksum = crcCalculator.crc24(data, crc24Checksum);
58+
if (crc32) crc32Checksum = crcCalculator.crc32(data, crc32Checksum);
4959
});
5060

5161
s.on('end', () => {
@@ -107,6 +117,30 @@
107117
.toString()
108118
});
109119
}
120+
if (crc1) {
121+
newHashes.push({
122+
type: 'CRC1',
123+
hash: crc1Checksum.toString(16),
124+
});
125+
}
126+
if (crc8) {
127+
newHashes.push({
128+
type: 'CRC8',
129+
hash: crc8Checksum.toString(16),
130+
});
131+
}
132+
if (crc16) {
133+
newHashes.push({
134+
type: 'CRC16',
135+
hash: crc16Checksum.toString(16),
136+
});
137+
}
138+
if (crc24) {
139+
newHashes.push({
140+
type: 'CRC24',
141+
hash: crc24Checksum.toString(16),
142+
});
143+
}
110144
if (crc32) {
111145
newHashes.push({
112146
type: 'CRC32',
@@ -115,12 +149,10 @@
115149
}
116150

117151
if (newHashes.length === 0) newHashes = null;
118-
119152
return resolve(newHashes);
120153
});
121154

122155
s.on('error', error => {
123-
124156
return reject(error);
125157
});
126158
} catch (error) {
@@ -130,7 +162,10 @@
130162
}
131163

132164
ipcRenderer.on("calculate-file-hash", (e, data) => {
133-
fileHash(data.filePath, data.md4, data.md5, data.sha1, data.sha224, data.sha256, data.sha384, data.sha512, data.ripemd160, data.crc32)
165+
fileHash(
166+
data.filePath, data.md4, data.md5, data.sha1, data.sha224, data.sha256, data.sha384, data.sha512,
167+
data.ripemd160, data.crc1, data.crc8, data.crc16, data.crc24, data.crc32,
168+
)
134169
.then(data => {
135170
ipcRenderer.send("file-hash-calculated", data);
136171
})

public/workers/TextWorker/index.html

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
const ipcRenderer = window.require('electron').ipcRenderer;
1010
const crypto = window.require('crypto');
1111

12-
const textHash = (text, md4, md5, sha1, sha224, sha256, sha384, sha512, ripemd160, crc32) => {
12+
const textHash = (
13+
text, md4, md5, sha1, sha224, sha256, sha384, sha512, ripemd160,
14+
crc1, crc8, crc16, crc24, crc32,
15+
) => {
1316
return new Promise((resolve, reject) => {
1417
let newHashes = [];
1518
try {
@@ -85,6 +88,34 @@
8588
.toString()
8689
});
8790
}
91+
if (crc1) {
92+
const { crc1 } = require('crc');
93+
newHashes.push({
94+
type: 'CRC1',
95+
hash: crc1(text).toString(16),
96+
});
97+
}
98+
if (crc8) {
99+
const { crc8 } = require('crc');
100+
newHashes.push({
101+
type: 'CRC8',
102+
hash: crc8(text).toString(16),
103+
});
104+
}
105+
if (crc16) {
106+
const { crc16 } = require('crc');
107+
newHashes.push({
108+
type: 'CRC16',
109+
hash: crc16(text).toString(16),
110+
});
111+
}
112+
if (crc24) {
113+
const { crc24 } = require('crc');
114+
newHashes.push({
115+
type: 'CRC24',
116+
hash: crc24(text).toString(16),
117+
});
118+
}
88119
if (crc32) {
89120
const { crc32 } = require('crc');
90121
newHashes.push({
@@ -94,7 +125,6 @@
94125
}
95126

96127
if (newHashes.length === 0) newHashes = null;
97-
98128
return resolve(newHashes);
99129
} catch (ex) {
100130
return reject(ex);
@@ -103,7 +133,10 @@
103133
};
104134

105135
ipcRenderer.on('calculate-text-hash', (e, data) => {
106-
textHash(data.text, data.md4, data.md5, data.sha1, data.sha224, data.sha256, data.sha384, data.sha512, data.ripemd160, data.crc32)
136+
textHash(
137+
data.text, data.md4, data.md5, data.sha1, data.sha224, data.sha256, data.sha384, data.sha512, data.ripemd160,
138+
data.crc1, data.crc8, data.crc16, data.crc24, data.crc32,
139+
)
107140
.then(data => {
108141
ipcRenderer.send('text-hash-calculated', data);
109142
})

src/contexts/CryptoContextReducer/index.jsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ const sha256 = localStorage.sha256 && localStorage.sha256 === 'true' ? true : !l
99
const sha384 = localStorage.sha384 && localStorage.sha384 === 'true' ? true : !localStorage.sha384;
1010
const sha512 = localStorage.sha512 && localStorage.sha512 === 'true' ? true : !localStorage.sha512;
1111
const ripemd160 = localStorage.ripemd160 && localStorage.ripemd160 === 'true' ? true : !localStorage.ripemd160;
12+
const crc1 = !!(localStorage.crc1 && localStorage.crc1 === 'true');
13+
const crc8 = !!(localStorage.crc8 && localStorage.crc8 === 'true');
14+
const crc16 = !!(localStorage.crc16 && localStorage.crc16 === 'true');
15+
const crc24 = !!(localStorage.crc24 && localStorage.crc24 === 'true');
1216
const crc32 = localStorage.crc32 && localStorage.crc32 === 'true' ? true : !localStorage.crc32;
1317

1418
const initState = {
@@ -20,6 +24,10 @@ const initState = {
2024
sha384,
2125
sha512,
2226
ripemd160,
27+
crc1,
28+
crc8,
29+
crc16,
30+
crc24,
2331
crc32,
2432
fileHashes: null,
2533
textHashes: null,

src/languages/de_DE/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ const de_DE = () => ({
4040
sha512: 'SHA-512',
4141
ripemd160: 'RIPEMD-160',
4242
sha224: 'SHA-224',
43+
crc1: 'CRC1',
44+
crc8: 'CRC8',
45+
crc16: 'CRC16',
46+
crc24: 'CRC24',
4347
crc32: 'CRC32',
4448
file: 'Datei',
4549
fileSubtitle: 'Berechnen Sie Datei-Hashes',
@@ -82,6 +86,13 @@ const de_DE = () => ({
8286
orange: 'Orange',
8387
orangeThemeDescription: 'Lass uns Niederländisch werden.',
8488
themeToggleEnabled: 'Thema umschalten',
89+
cyclicRedundancyCheck: 'Zyklische Redundanzprüfung',
90+
deepOrange: 'Tiefes Orange',
91+
deepOrangeDescription: 'Für den Fall, dass Orange nicht genug war.',
92+
amber: 'Amber',
93+
amberDescription: 'Nicht selektives Gelb.',
94+
brown: 'Braun',
95+
brownDescription: 'Besser als ein Brownout.',
8596
});
8697

8798
// eslint-disable-next-line camelcase

src/languages/en_US/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ const en_US = () => ({
4040
sha512: 'SHA-512',
4141
ripemd160: 'RIPEMD-160',
4242
sha224: 'SHA-224',
43+
crc1: 'CRC1',
44+
crc8: 'CRC8',
45+
crc16: 'CRC16',
46+
crc24: 'CRC24',
4347
crc32: 'CRC32',
4448
file: 'File',
4549
fileSubtitle: 'Calculate file hashes',
@@ -82,6 +86,13 @@ const en_US = () => ({
8286
orange: 'Orange',
8387
orangeThemeDescription: 'Let\'s get Dutch.',
8488
themeToggleEnabled: 'Theme toggle',
89+
cyclicRedundancyCheck: 'Cyclic redundancy check',
90+
deepOrange: 'Deep orange',
91+
deepOrangeDescription: 'In case orange wasn\'t enough.',
92+
amber: 'Amber',
93+
amberDescription: 'Not selective yellow.',
94+
brown: 'Brown',
95+
brownDescription: 'Better than a brownout.',
8596
});
8697

8798
// eslint-disable-next-line camelcase

src/languages/es_ES/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ const es_ES = () => ({
4040
sha512: 'SHA-512',
4141
ripemd160: 'RIPEMD-160',
4242
sha224: 'SHA-224',
43+
crc1: 'CRC1',
44+
crc8: 'CRC8',
45+
crc16: 'CRC16',
46+
crc24: 'CRC24',
4347
crc32: 'CRC32',
4448
file: 'Archivo',
4549
fileSubtitle: 'Calcular hashes de archivos',
@@ -82,6 +86,13 @@ const es_ES = () => ({
8286
orange: 'Naranja',
8387
orangeThemeDescription: 'Vamos a holandeses.',
8488
themeToggleEnabled: 'Alternar tema',
89+
cyclicRedundancyCheck: 'Verificación de redundancia cíclica',
90+
deepOrange: 'Naranja intenso',
91+
deepOrangeDescription: 'En caso de que el naranja no fuera suficiente.',
92+
amber: 'Ámbar',
93+
amberDescription: 'No selectivo amarillo.',
94+
brown: 'Marrón',
95+
brownDescription: 'Mejor que un apagón.',
8596
});
8697

8798
// eslint-disable-next-line camelcase

src/languages/fr_FR/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ const fr_FR = () => ({
4040
sha512: 'SHA-512',
4141
ripemd160: 'RIPEMD-160',
4242
sha224: 'SHA-224',
43+
crc1: 'CRC1',
44+
crc8: 'CRC8',
45+
crc16: 'CRC16',
46+
crc24: 'CRC24',
4347
crc32: 'CRC32',
4448
file: 'File',
4549
fileSubtitle: 'Calculer les hachages de fichier',
@@ -82,6 +86,13 @@ const fr_FR = () => ({
8286
orange: 'Orange',
8387
orangeThemeDescription: 'Il faut que ça Néerlandais.',
8488
themeToggleEnabled: 'Basculer le thème',
89+
cyclicRedundancyCheck: 'Contrôle de redondance cyclique',
90+
deepOrange: 'Orange foncé',
91+
deepOrangeDescription: 'Au cas où l\'orange ne suffirait pas.',
92+
amber: 'Ambre',
93+
amberDescription: 'Jaune non sélectif.',
94+
brown: 'Marron',
95+
brownDescription: 'Mieux qu\'une baisse de tension.',
8596
});
8697

8798
// eslint-disable-next-line camelcase

src/languages/it_IT/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ const it_IT = () => ({
4040
sha512: 'SHA-512',
4141
ripemd160: 'RIPEMD-160',
4242
sha224: 'SHA-224',
43+
crc1: 'CRC1',
44+
crc8: 'CRC8',
45+
crc16: 'CRC16',
46+
crc24: 'CRC24',
4347
crc32: 'CRC32',
4448
file: 'File',
4549
fileSubtitle: 'Calcola gli hash dei file',
@@ -82,6 +86,13 @@ const it_IT = () => ({
8286
orange: 'Arancia',
8387
orangeThemeDescription: 'Prendiamo l\'olandese.',
8488
themeToggleEnabled: 'Commutazione del tema',
89+
cyclicRedundancyCheck: 'Controllo di ridondanza ciclico',
90+
deepOrange: 'Arancio intenso',
91+
deepOrangeDescription: 'Nel caso l\'arancione non fosse abbastanza.',
92+
amber: 'Ambra',
93+
amberDescription: 'Giallo non selettivo.',
94+
brown: 'Marrone',
95+
brownDescription: 'Meglio di un brownout.',
8596
});
8697

8798
// eslint-disable-next-line camelcase

src/languages/jp_JP/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ const jp_JP = () => ({
4040
sha512: 'SHA-512',
4141
ripemd160: 'RIPEMD-160',
4242
sha224: 'SHA-224',
43+
crc1: 'CRC1',
44+
crc8: 'CRC8',
45+
crc16: 'CRC16',
46+
crc24: 'CRC24',
4347
crc32: 'CRC32',
4448
file: 'ファイル',
4549
fileSubtitle: 'ファイルハッシュの計算',
@@ -82,6 +86,13 @@ const jp_JP = () => ({
8286
orange: 'オレンジ',
8387
orangeThemeDescription: 'オランダ語を取得しましょう。',
8488
themeToggleEnabled: 'テーマの切り替え',
89+
cyclicRedundancyCheck: '巡回冗長検査',
90+
deepOrange: '濃いオレンジ',
91+
deepOrangeDescription: 'オレンジでは不十分な場合に備えて。',
92+
amber: 'アンバー',
93+
amberDescription: '選択的ではない黄色。',
94+
brown: '褐色',
95+
brownDescription: '電圧低下よりも優れています。',
8596
});
8697

8798
// eslint-disable-next-line camelcase

0 commit comments

Comments
 (0)