diff --git a/README.md b/README.md index 22ea799..2efa349 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ![GitHub package.json version](https://img.shields.io/github/package-json/v/CodeDead/DeadHash-js) ![GitHub](https://img.shields.io/github/license/CodeDead/DeadHash-Js) -![GitHub Releases (by Release)](https://img.shields.io/github/downloads/CodeDead/DeadHash-js/2.1.1/total) +![GitHub Releases (by Release)](https://img.shields.io/github/downloads/CodeDead/DeadHash-js/2.1.2/total) DeadHash is a free and open-source utility to calculate file and text hashes and checksums. The following calculations are supported: @@ -16,6 +16,10 @@ DeadHash is a free and open-source utility to calculate file and text hashes and * SHA-384 * SHA-512 * RIPEMD-160 +* CRC1 +* CRC8 +* CRC16 +* CRC24 * CRC32 This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app) and built using [Electron](https://electronjs.org/). diff --git a/package.json b/package.json index b673851..23a2939 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "deadhash", - "version": "2.1.1", + "version": "2.1.2", "description": "File and text hash calculator", "homepage": "./", "private": true, @@ -71,7 +71,7 @@ }, "devDependencies": { "concurrently": "^5.3.0", - "electron": "^11.2.2", + "electron": "^11.2.3", "electron-builder": "^22.9.1", "eslint": "^7.19.0", "eslint-config-airbnb": "^18.2.1", diff --git a/public/workers/FileWorker/index.html b/public/workers/FileWorker/index.html index 35b2a9f..606de93 100644 --- a/public/workers/FileWorker/index.html +++ b/public/workers/FileWorker/index.html @@ -9,9 +9,12 @@ const ipcRenderer = window.require('electron').ipcRenderer; const fs = window.require('fs'); const crypto = window.require('crypto'); - const crc32Calculator = require('crc').crc32; + const crcCalculator = require('crc'); - const fileHash = (filePath, md4, md5, sha1, sha224, sha256, sha384, sha512, ripemd160, crc32) => { + const fileHash = ( + filePath, md4, md5, sha1, sha224, sha256, sha384, sha512, ripemd160, + crc1, crc8, crc16, crc24, crc32, + ) => { return new Promise((resolve, reject) => { let MD4, MD5, @@ -21,7 +24,11 @@ SHA384, SHA512, RIPEMD160, - crc32Checksum; + crc1Checksum, + crc8Checksum, + crc16Checksum, + crc24Checksum, + crc32Checksum; if (md4) MD4 = crypto.createHash('md4'); if (md5) MD5 = crypto.createHash('md5'); @@ -32,7 +39,6 @@ if (sha512) SHA512 = crypto.createHash('sha512'); if (ripemd160) RIPEMD160 = crypto.createHash('ripemd160'); - try { const s = fs.createReadStream(filePath.toString()); @@ -45,7 +51,11 @@ if (sha384) SHA384.update(data); if (sha512) SHA512.update(data); if (ripemd160) RIPEMD160.update(data); - if (crc32) crc32Checksum = crc32Calculator(data, crc32Checksum); + if (crc1) crc1Checksum = crcCalculator.crc1(data, crc1Checksum); + if (crc8) crc8Checksum = crcCalculator.crc8(data, crc8Checksum); + if (crc16) crc16Checksum = crcCalculator.crc16(data, crc16Checksum); + if (crc24) crc24Checksum = crcCalculator.crc24(data, crc24Checksum); + if (crc32) crc32Checksum = crcCalculator.crc32(data, crc32Checksum); }); s.on('end', () => { @@ -107,6 +117,30 @@ .toString() }); } + if (crc1) { + newHashes.push({ + type: 'CRC1', + hash: crc1Checksum.toString(16), + }); + } + if (crc8) { + newHashes.push({ + type: 'CRC8', + hash: crc8Checksum.toString(16), + }); + } + if (crc16) { + newHashes.push({ + type: 'CRC16', + hash: crc16Checksum.toString(16), + }); + } + if (crc24) { + newHashes.push({ + type: 'CRC24', + hash: crc24Checksum.toString(16), + }); + } if (crc32) { newHashes.push({ type: 'CRC32', @@ -115,12 +149,10 @@ } if (newHashes.length === 0) newHashes = null; - return resolve(newHashes); }); s.on('error', error => { - return reject(error); }); } catch (error) { @@ -130,7 +162,10 @@ } ipcRenderer.on("calculate-file-hash", (e, data) => { - fileHash(data.filePath, data.md4, data.md5, data.sha1, data.sha224, data.sha256, data.sha384, data.sha512, data.ripemd160, data.crc32) + fileHash( + data.filePath, data.md4, data.md5, data.sha1, data.sha224, data.sha256, data.sha384, data.sha512, + data.ripemd160, data.crc1, data.crc8, data.crc16, data.crc24, data.crc32, + ) .then(data => { ipcRenderer.send("file-hash-calculated", data); }) diff --git a/public/workers/TextWorker/index.html b/public/workers/TextWorker/index.html index 83f411c..7ba0238 100644 --- a/public/workers/TextWorker/index.html +++ b/public/workers/TextWorker/index.html @@ -9,7 +9,10 @@ const ipcRenderer = window.require('electron').ipcRenderer; const crypto = window.require('crypto'); - const textHash = (text, md4, md5, sha1, sha224, sha256, sha384, sha512, ripemd160, crc32) => { + const textHash = ( + text, md4, md5, sha1, sha224, sha256, sha384, sha512, ripemd160, + crc1, crc8, crc16, crc24, crc32, + ) => { return new Promise((resolve, reject) => { let newHashes = []; try { @@ -85,6 +88,34 @@ .toString() }); } + if (crc1) { + const { crc1 } = require('crc'); + newHashes.push({ + type: 'CRC1', + hash: crc1(text).toString(16), + }); + } + if (crc8) { + const { crc8 } = require('crc'); + newHashes.push({ + type: 'CRC8', + hash: crc8(text).toString(16), + }); + } + if (crc16) { + const { crc16 } = require('crc'); + newHashes.push({ + type: 'CRC16', + hash: crc16(text).toString(16), + }); + } + if (crc24) { + const { crc24 } = require('crc'); + newHashes.push({ + type: 'CRC24', + hash: crc24(text).toString(16), + }); + } if (crc32) { const { crc32 } = require('crc'); newHashes.push({ @@ -94,7 +125,6 @@ } if (newHashes.length === 0) newHashes = null; - return resolve(newHashes); } catch (ex) { return reject(ex); @@ -103,7 +133,10 @@ }; ipcRenderer.on('calculate-text-hash', (e, data) => { - textHash(data.text, data.md4, data.md5, data.sha1, data.sha224, data.sha256, data.sha384, data.sha512, data.ripemd160, data.crc32) + textHash( + data.text, data.md4, data.md5, data.sha1, data.sha224, data.sha256, data.sha384, data.sha512, data.ripemd160, + data.crc1, data.crc8, data.crc16, data.crc24, data.crc32, + ) .then(data => { ipcRenderer.send('text-hash-calculated', data); }) diff --git a/src/contexts/CryptoContextReducer/index.jsx b/src/contexts/CryptoContextReducer/index.jsx index ce354cc..4abcdef 100644 --- a/src/contexts/CryptoContextReducer/index.jsx +++ b/src/contexts/CryptoContextReducer/index.jsx @@ -9,6 +9,10 @@ const sha256 = localStorage.sha256 && localStorage.sha256 === 'true' ? true : !l const sha384 = localStorage.sha384 && localStorage.sha384 === 'true' ? true : !localStorage.sha384; const sha512 = localStorage.sha512 && localStorage.sha512 === 'true' ? true : !localStorage.sha512; const ripemd160 = localStorage.ripemd160 && localStorage.ripemd160 === 'true' ? true : !localStorage.ripemd160; +const crc1 = !!(localStorage.crc1 && localStorage.crc1 === 'true'); +const crc8 = !!(localStorage.crc8 && localStorage.crc8 === 'true'); +const crc16 = !!(localStorage.crc16 && localStorage.crc16 === 'true'); +const crc24 = !!(localStorage.crc24 && localStorage.crc24 === 'true'); const crc32 = localStorage.crc32 && localStorage.crc32 === 'true' ? true : !localStorage.crc32; const initState = { @@ -20,6 +24,10 @@ const initState = { sha384, sha512, ripemd160, + crc1, + crc8, + crc16, + crc24, crc32, fileHashes: null, textHashes: null, diff --git a/src/languages/de_DE/index.js b/src/languages/de_DE/index.js index 778f363..a1a4b79 100644 --- a/src/languages/de_DE/index.js +++ b/src/languages/de_DE/index.js @@ -40,6 +40,10 @@ const de_DE = () => ({ sha512: 'SHA-512', ripemd160: 'RIPEMD-160', sha224: 'SHA-224', + crc1: 'CRC1', + crc8: 'CRC8', + crc16: 'CRC16', + crc24: 'CRC24', crc32: 'CRC32', file: 'Datei', fileSubtitle: 'Berechnen Sie Datei-Hashes', @@ -82,6 +86,13 @@ const de_DE = () => ({ orange: 'Orange', orangeThemeDescription: 'Lass uns Niederländisch werden.', themeToggleEnabled: 'Thema umschalten', + cyclicRedundancyCheck: 'Zyklische Redundanzprüfung', + deepOrange: 'Tiefes Orange', + deepOrangeDescription: 'Für den Fall, dass Orange nicht genug war.', + amber: 'Amber', + amberDescription: 'Nicht selektives Gelb.', + brown: 'Braun', + brownDescription: 'Besser als ein Brownout.', }); // eslint-disable-next-line camelcase diff --git a/src/languages/en_US/index.js b/src/languages/en_US/index.js index 19c90c5..f77ec54 100644 --- a/src/languages/en_US/index.js +++ b/src/languages/en_US/index.js @@ -40,6 +40,10 @@ const en_US = () => ({ sha512: 'SHA-512', ripemd160: 'RIPEMD-160', sha224: 'SHA-224', + crc1: 'CRC1', + crc8: 'CRC8', + crc16: 'CRC16', + crc24: 'CRC24', crc32: 'CRC32', file: 'File', fileSubtitle: 'Calculate file hashes', @@ -82,6 +86,13 @@ const en_US = () => ({ orange: 'Orange', orangeThemeDescription: 'Let\'s get Dutch.', themeToggleEnabled: 'Theme toggle', + cyclicRedundancyCheck: 'Cyclic redundancy check', + deepOrange: 'Deep orange', + deepOrangeDescription: 'In case orange wasn\'t enough.', + amber: 'Amber', + amberDescription: 'Not selective yellow.', + brown: 'Brown', + brownDescription: 'Better than a brownout.', }); // eslint-disable-next-line camelcase diff --git a/src/languages/es_ES/index.js b/src/languages/es_ES/index.js index 95ca675..f9d5b81 100644 --- a/src/languages/es_ES/index.js +++ b/src/languages/es_ES/index.js @@ -40,6 +40,10 @@ const es_ES = () => ({ sha512: 'SHA-512', ripemd160: 'RIPEMD-160', sha224: 'SHA-224', + crc1: 'CRC1', + crc8: 'CRC8', + crc16: 'CRC16', + crc24: 'CRC24', crc32: 'CRC32', file: 'Archivo', fileSubtitle: 'Calcular hashes de archivos', @@ -82,6 +86,13 @@ const es_ES = () => ({ orange: 'Naranja', orangeThemeDescription: 'Vamos a holandeses.', themeToggleEnabled: 'Alternar tema', + cyclicRedundancyCheck: 'Verificación de redundancia cíclica', + deepOrange: 'Naranja intenso', + deepOrangeDescription: 'En caso de que el naranja no fuera suficiente.', + amber: 'Ámbar', + amberDescription: 'No selectivo amarillo.', + brown: 'Marrón', + brownDescription: 'Mejor que un apagón.', }); // eslint-disable-next-line camelcase diff --git a/src/languages/fr_FR/index.js b/src/languages/fr_FR/index.js index 2210359..8ca4a22 100644 --- a/src/languages/fr_FR/index.js +++ b/src/languages/fr_FR/index.js @@ -40,6 +40,10 @@ const fr_FR = () => ({ sha512: 'SHA-512', ripemd160: 'RIPEMD-160', sha224: 'SHA-224', + crc1: 'CRC1', + crc8: 'CRC8', + crc16: 'CRC16', + crc24: 'CRC24', crc32: 'CRC32', file: 'File', fileSubtitle: 'Calculer les hachages de fichier', @@ -82,6 +86,13 @@ const fr_FR = () => ({ orange: 'Orange', orangeThemeDescription: 'Il faut que ça Néerlandais.', themeToggleEnabled: 'Basculer le thème', + cyclicRedundancyCheck: 'Contrôle de redondance cyclique', + deepOrange: 'Orange foncé', + deepOrangeDescription: 'Au cas où l\'orange ne suffirait pas.', + amber: 'Ambre', + amberDescription: 'Jaune non sélectif.', + brown: 'Marron', + brownDescription: 'Mieux qu\'une baisse de tension.', }); // eslint-disable-next-line camelcase diff --git a/src/languages/it_IT/index.js b/src/languages/it_IT/index.js index 1e2dc00..b8a5f87 100644 --- a/src/languages/it_IT/index.js +++ b/src/languages/it_IT/index.js @@ -40,6 +40,10 @@ const it_IT = () => ({ sha512: 'SHA-512', ripemd160: 'RIPEMD-160', sha224: 'SHA-224', + crc1: 'CRC1', + crc8: 'CRC8', + crc16: 'CRC16', + crc24: 'CRC24', crc32: 'CRC32', file: 'File', fileSubtitle: 'Calcola gli hash dei file', @@ -82,6 +86,13 @@ const it_IT = () => ({ orange: 'Arancia', orangeThemeDescription: 'Prendiamo l\'olandese.', themeToggleEnabled: 'Commutazione del tema', + cyclicRedundancyCheck: 'Controllo di ridondanza ciclico', + deepOrange: 'Arancio intenso', + deepOrangeDescription: 'Nel caso l\'arancione non fosse abbastanza.', + amber: 'Ambra', + amberDescription: 'Giallo non selettivo.', + brown: 'Marrone', + brownDescription: 'Meglio di un brownout.', }); // eslint-disable-next-line camelcase diff --git a/src/languages/jp_JP/index.js b/src/languages/jp_JP/index.js index 4e68003..ba706c7 100644 --- a/src/languages/jp_JP/index.js +++ b/src/languages/jp_JP/index.js @@ -40,6 +40,10 @@ const jp_JP = () => ({ sha512: 'SHA-512', ripemd160: 'RIPEMD-160', sha224: 'SHA-224', + crc1: 'CRC1', + crc8: 'CRC8', + crc16: 'CRC16', + crc24: 'CRC24', crc32: 'CRC32', file: 'ファイル', fileSubtitle: 'ファイルハッシュの計算', @@ -82,6 +86,13 @@ const jp_JP = () => ({ orange: 'オレンジ', orangeThemeDescription: 'オランダ語を取得しましょう。', themeToggleEnabled: 'テーマの切り替え', + cyclicRedundancyCheck: '巡回冗長検査', + deepOrange: '濃いオレンジ', + deepOrangeDescription: 'オレンジでは不十分な場合に備えて。', + amber: 'アンバー', + amberDescription: '選択的ではない黄色。', + brown: '褐色', + brownDescription: '電圧低下よりも優れています。', }); // eslint-disable-next-line camelcase diff --git a/src/languages/nl_NL/index.js b/src/languages/nl_NL/index.js index af14b8f..433a75b 100644 --- a/src/languages/nl_NL/index.js +++ b/src/languages/nl_NL/index.js @@ -40,6 +40,10 @@ const nl_NL = () => ({ sha512: 'SHA-512', ripemd160: 'RIPEMD-160', sha224: 'SHA-224', + crc1: 'CRC1', + crc8: 'CRC8', + crc16: 'CRC16', + crc24: 'CRC24', crc32: 'CRC32', file: 'Bestand', fileSubtitle: 'Bereken bestand hashes', @@ -82,6 +86,13 @@ const nl_NL = () => ({ orange: 'Oranje', orangeThemeDescription: 'Op z\'n Nederlands.', themeToggleEnabled: 'Thema wisselen', + cyclicRedundancyCheck: 'Cyclische redundantiecontrole', + deepOrange: 'Diep oranje', + deepOrangeDescription: 'Voor het geval oranje niet genoeg was.', + amber: 'Amber', + amberDescription: 'Niet selectief geel.', + brown: 'Bruin', + brownDescription: 'Beter dan een brownout.', }); // eslint-disable-next-line camelcase diff --git a/src/languages/pt_PT/index.js b/src/languages/pt_PT/index.js index 9c921cd..8fffc78 100644 --- a/src/languages/pt_PT/index.js +++ b/src/languages/pt_PT/index.js @@ -40,6 +40,10 @@ const pt_PT = () => ({ sha512: 'SHA-512', ripemd160: 'RIPEMD-160', sha224: 'SHA-224', + crc1: 'CRC1', + crc8: 'CRC8', + crc16: 'CRC16', + crc24: 'CRC24', crc32: 'CRC32', file: 'Arquivo', fileSubtitle: 'Calcular hashes de arquivo', @@ -82,6 +86,13 @@ const pt_PT = () => ({ orange: 'Laranja', orangeThemeDescription: 'Vamos para o holandês.', themeToggleEnabled: 'Alternar tema', + cyclicRedundancyCheck: 'Verificação de redundância Cíclica', + deepOrange: 'Laranja profundo', + deepOrangeDescription: 'No caso de laranja não ser suficiente.', + amber: 'Âmbar', + amberDescription: 'Amarelo não seletivo.', + brown: 'Castanho', + brownDescription: 'Melhor do que um brownout.', }); // eslint-disable-next-line camelcase diff --git a/src/languages/ru_RU/index.js b/src/languages/ru_RU/index.js index 269bfbc..f98e506 100644 --- a/src/languages/ru_RU/index.js +++ b/src/languages/ru_RU/index.js @@ -40,6 +40,10 @@ const ru_RU = () => ({ sha512: 'SHA-512', ripemd160: 'RIPEMD-160', sha224: 'SHA-224', + crc1: 'CRC1', + crc8: 'CRC8', + crc16: 'CRC16', + crc24: 'CRC24', crc32: 'CRC32', file: 'файл', fileSubtitle: 'Рассчитать хэши файлов', @@ -82,6 +86,13 @@ const ru_RU = () => ({ orange: 'Оранжевый', orangeThemeDescription: 'Давайте перейдем к голландскому.', themeToggleEnabled: 'Переключение темы', + cyclicRedundancyCheck: 'Циклическая проверка избыточности', + deepOrange: 'Темно-оранжевый', + deepOrangeDescription: 'На случай, если оранжевого было недостаточно.', + amber: 'Янтарь', + amberDescription: 'Неселективный желтый.', + brown: 'Коричневый', + brownDescription: 'Лучше, чем отключение электричества.', }); // eslint-disable-next-line camelcase diff --git a/src/languages/tr_TR/index.js b/src/languages/tr_TR/index.js index 3ad0b01..b7148ce 100644 --- a/src/languages/tr_TR/index.js +++ b/src/languages/tr_TR/index.js @@ -40,6 +40,10 @@ const tr_TR = () => ({ sha512: 'SHA-512', ripemd160: 'RIPEMD-160', sha224: 'SHA-224', + crc1: 'CRC1', + crc8: 'CRC8', + crc16: 'CRC16', + crc24: 'CRC24', crc32: 'CRC32', file: 'Dosya', fileSubtitle: 'Dosya karmaları hesapla', @@ -82,6 +86,13 @@ const tr_TR = () => ({ orange: 'Turuncu', orangeThemeDescription: 'Dutch alalım.', themeToggleEnabled: 'Tema geçişi', + cyclicRedundancyCheck: 'Döngüsel artıklık denetimi', + deepOrange: 'Koyu turuncu', + deepOrangeDescription: 'Portakal yeterli değilse diye.', + amber: 'Kehribar', + amberDescription: 'Seçici sarı değil.', + brown: 'Kahverengi', + brownDescription: 'Kesintiden daha iyi.', }); // eslint-disable-next-line camelcase diff --git a/src/reducers/CryptoReducer/Actions/actionTypes.js b/src/reducers/CryptoReducer/Actions/actionTypes.js index 0965fdb..ea7c9c1 100644 --- a/src/reducers/CryptoReducer/Actions/actionTypes.js +++ b/src/reducers/CryptoReducer/Actions/actionTypes.js @@ -6,6 +6,10 @@ export const SET_SHA384_STATE = 'SET_SHA384_STATE'; export const SET_SHA512_STATE = 'SET_SHA512_STATE'; export const SET_RIPEMD160_STATE = 'SET_RIPEMD160_STATE'; export const SET_SHA224_STATE = 'SET_SHA224_STATE'; +export const SET_CRC1_STATE = 'SET_CRC1_STATE'; +export const SET_CRC8_STATE = 'SET_CRC8_STATE'; +export const SET_CRC16_STATE = 'SET_CRC16_STATE'; +export const SET_CRC24_STATE = 'SET_CRC24_STATE'; export const SET_CRC32_STATE = 'SET_CRC32_STATE'; export const RESET_CRYPTO_REDUCER = 'RESET_CRYPTO_REDUCER'; export const SET_FILE_HASHES = 'SET_FILE_HASHES'; diff --git a/src/reducers/CryptoReducer/Actions/index.js b/src/reducers/CryptoReducer/Actions/index.js index 85fb5df..8fc7c5c 100644 --- a/src/reducers/CryptoReducer/Actions/index.js +++ b/src/reducers/CryptoReducer/Actions/index.js @@ -1,5 +1,9 @@ import { RESET_CRYPTO_REDUCER, + SET_CRC1_STATE, + SET_CRC8_STATE, + SET_CRC16_STATE, + SET_CRC24_STATE, SET_CRC32_STATE, SET_CURRENT_FILE, SET_FILE_COMPARE_HASH, @@ -63,6 +67,26 @@ export const setSha224State = (state) => ({ payload: state, }); +export const setCrc1State = (state) => ({ + type: SET_CRC1_STATE, + payload: state, +}); + +export const setCrc8State = (state) => ({ + type: SET_CRC8_STATE, + payload: state, +}); + +export const setCrc16State = (state) => ({ + type: SET_CRC16_STATE, + payload: state, +}); + +export const setCrc24State = (state) => ({ + type: SET_CRC24_STATE, + payload: state, +}); + export const setCrc32State = (state) => ({ type: SET_CRC32_STATE, payload: state, diff --git a/src/reducers/CryptoReducer/index.js b/src/reducers/CryptoReducer/index.js index 0353635..3b42c90 100644 --- a/src/reducers/CryptoReducer/index.js +++ b/src/reducers/CryptoReducer/index.js @@ -1,5 +1,9 @@ import { RESET_CRYPTO_REDUCER, + SET_CRC1_STATE, + SET_CRC8_STATE, + SET_CRC16_STATE, + SET_CRC24_STATE, SET_CRC32_STATE, SET_CURRENT_FILE, SET_FILE_COMPARE_HASH, @@ -75,6 +79,30 @@ const CryptoReducer = (state, action) => { ...state, sha224: action.payload, }; + case SET_CRC1_STATE: + localStorage.crc1 = action.payload; + return { + ...state, + crc1: action.payload, + }; + case SET_CRC8_STATE: + localStorage.crc8 = action.payload; + return { + ...state, + crc8: action.payload, + }; + case SET_CRC16_STATE: + localStorage.crc16 = action.payload; + return { + ...state, + crc16: action.payload, + }; + case SET_CRC24_STATE: + localStorage.crc24 = action.payload; + return { + ...state, + crc24: action.payload, + }; case SET_CRC32_STATE: localStorage.crc32 = action.payload; return { @@ -90,6 +118,10 @@ const CryptoReducer = (state, action) => { localStorage.sha512 = true; localStorage.ripemd160 = true; localStorage.sha224 = true; + localStorage.crc1 = false; + localStorage.crc8 = false; + localStorage.crc16 = false; + localStorage.crc24 = false; localStorage.crc32 = true; return { @@ -102,6 +134,10 @@ const CryptoReducer = (state, action) => { sha384: true, sha512: true, ripemd160: true, + crc1: false, + crc8: false, + crc16: false, + crc24: false, crc32: true, }; case SET_TEXT_HASHES: diff --git a/src/routes/File/index.jsx b/src/routes/File/index.jsx index 01d0c01..d7d5354 100644 --- a/src/routes/File/index.jsx +++ b/src/routes/File/index.jsx @@ -59,7 +59,8 @@ const File = () => { const file = crypto.currentFile; const { - md4, md5, sha1, sha224, sha256, sha384, sha512, ripemd160, crc32, + md4, md5, sha1, sha224, sha256, sha384, sha512, ripemd160, + crc1, crc8, crc16, crc24, crc32, } = crypto; const compare = crypto.fileComparing; @@ -146,6 +147,10 @@ const File = () => { sha384, sha512, ripemd160, + crc1, + crc8, + crc16, + crc24, crc32, }); }; diff --git a/src/routes/Settings/index.jsx b/src/routes/Settings/index.jsx index e0f16a0..be9fbc3 100644 --- a/src/routes/Settings/index.jsx +++ b/src/routes/Settings/index.jsx @@ -14,6 +14,9 @@ import green from '@material-ui/core/colors/green'; import lightGreen from '@material-ui/core/colors/lightGreen'; import grey from '@material-ui/core/colors/grey'; import orange from '@material-ui/core/colors/orange'; +import deepOrange from '@material-ui/core/colors/deepOrange'; +import amber from '@material-ui/core/colors/amber'; +import brown from '@material-ui/core/colors/brown'; import Paper from '@material-ui/core/Paper'; import FormControlLabel from '@material-ui/core/FormControlLabel'; import Checkbox from '@material-ui/core/Checkbox'; @@ -56,6 +59,10 @@ import { setSha256State, setSha384State, setSha512State, + setCrc1State, + setCrc8State, + setCrc16State, + setCrc24State, setCrc32State, } from '../../reducers/CryptoReducer/Actions'; @@ -105,7 +112,8 @@ const Settings = () => { const language = state.languages[languageIndex]; const { - md4, md5, sha1, sha224, sha256, sha384, sha512, ripemd160, crc32, + md4, md5, sha1, sha224, sha256, sha384, sha512, ripemd160, + crc1, crc8, crc16, crc24, crc32, } = crypto; const [errorMessage, setErrorMessage] = useState(null); @@ -417,7 +425,59 @@ const Settings = () => { )} label={language.ripemd160} /> - + + + + + + {language.cyclicRedundancyCheck} + + +
+ d2(setCrc1State(e.target.checked))} + value="crc1" + color="primary" + /> + )} + label={language.crc1} + /> + d2(setCrc8State(e.target.checked))} + value="crc8" + color="primary" + /> + )} + label={language.crc8} + /> + d2(setCrc16State(e.target.checked))} + value="crc16" + color="primary" + /> + )} + label={language.crc16} + /> + d2(setCrc24State(e.target.checked))} + value="crc24" + color="primary" + /> + )} + label={language.crc24} + /> { selected={themeIndex === 8} onAction={() => changeTheme(8)} /> + changeTheme(9)} + /> + changeTheme(10)} + /> + changeTheme(11)} + /> diff --git a/src/routes/Text/index.jsx b/src/routes/Text/index.jsx index b8b7f49..829f0cd 100644 --- a/src/routes/Text/index.jsx +++ b/src/routes/Text/index.jsx @@ -60,7 +60,8 @@ const Text = () => { const language = state.languages[state.languageIndex]; const { - md4, md5, sha1, sha224, sha256, sha384, sha512, ripemd160, crc32, + md4, md5, sha1, sha224, sha256, sha384, sha512, ripemd160, + crc1, crc8, crc16, crc24, crc32, } = crypto; const input = crypto.textInput; @@ -144,6 +145,10 @@ const Text = () => { sha384, sha512, ripemd160, + crc1, + crc8, + crc16, + crc24, crc32, }); }; diff --git a/src/utils/ThemeSelector/index.js b/src/utils/ThemeSelector/index.js index 8b66b29..3f820fc 100644 --- a/src/utils/ThemeSelector/index.js +++ b/src/utils/ThemeSelector/index.js @@ -7,6 +7,9 @@ import purple from '@material-ui/core/colors/purple'; import deepPurple from '@material-ui/core/colors/deepPurple'; import grey from '@material-ui/core/colors/grey'; import orange from '@material-ui/core/colors/orange'; +import deepOrange from '@material-ui/core/colors/deepOrange'; +import amber from '@material-ui/core/colors/amber'; +import brown from '@material-ui/core/colors/brown'; /** * Select the theme, depending on the theme index @@ -34,6 +37,12 @@ const ThemeSelector = (index) => { return grey; case 8: return orange; + case 9: + return deepOrange; + case 10: + return amber; + case 11: + return brown; } }; diff --git a/src/utils/Updater/index.js b/src/utils/Updater/index.js index 36cd145..633e5e6 100644 --- a/src/utils/Updater/index.js +++ b/src/utils/Updater/index.js @@ -33,7 +33,7 @@ const Updater = (os) => { version: null, }; - if (isNewer('2.1.1', `${platform.version.majorVersion}.${platform.version.minorVersion}.${platform.version.buildVersion}.${platform.version.revisionVersion}`)) { + if (isNewer('2.1.2', `${platform.version.majorVersion}.${platform.version.minorVersion}.${platform.version.buildVersion}.${platform.version.revisionVersion}`)) { data.updateAvailable = true; } diff --git a/yarn.lock b/yarn.lock index daed155..8a1e77e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6900,7 +6900,7 @@ __metadata: concurrently: ^5.3.0 crc: ^3.8.0 cross-env: ^7.0.3 - electron: ^11.2.2 + electron: ^11.2.3 electron-builder: ^22.9.1 electron-is-dev: ^1.2.0 eslint: ^7.19.0 @@ -7561,16 +7561,16 @@ __metadata: languageName: node linkType: hard -"electron@npm:^11.2.2": - version: 11.2.2 - resolution: "electron@npm:11.2.2" +"electron@npm:^11.2.3": + version: 11.2.3 + resolution: "electron@npm:11.2.3" dependencies: "@electron/get": ^1.0.1 "@types/node": ^12.0.12 extract-zip: ^1.0.3 bin: electron: cli.js - checksum: e38faf67f235257a38d2cebd3788d8d76be363a01eebdea88b6cb85d7f16b5b74fc0c8087b9d6a5dead8623770290a989f5cabca0b7c48dc8a622a5944adbcda + checksum: a80172bb463ca16916db7b3e5cf3d289bb0658e0279bddc5a3ae18c3985ba42578c9945fcd858986ba9275398709b4a211e8a4060deae6b124710d845809f007 languageName: node linkType: hard