Adicionar/Atualizar Algoritmos de Hash no RustHash - #3
Conversation
- Created a centralized algorithm registry detailing categories, descriptions, security levels, recommendations, and citations. - Added and compiled Rust dependencies and incremental WASM bindings for SHA-2, SHA-3, SHAKE, BLAKE2, RIPEMD-160, Whirlpool, SM3, and checksums. - Updated the background Web Worker to support dynamic and streaming updates. - Redesigned the React app interface with search, filters, modals, and localized security guidelines. Co-authored-by: erikraft <139592038+erikraft@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Free Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (6)
WalkthroughThe PR expands hashing support to 28 algorithms, adds a shared metadata registry, processes results dynamically in the worker, and adds a Portuguese algorithm explorer with search, filtering, security details, and dialogs. ChangesHash algorithm expansion
Estimated code review effort: 5 (Critical) | ~120 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant App
participant HashWorker
participant WASM
User->>App: enter text or select file
App->>HashWorker: start hashing request
HashWorker->>WASM: update configured hashers
WASM-->>HashWorker: finalize digest results
HashWorker-->>App: return dynamic result map
App-->>User: render filtered results and algorithm details
Poem
Note 🎁 Summarized by CodeRabbit FreeThe PR author is not assigned a seat. If you are a newly provisioned user and your organization has automatic seat assignment enabled, open a new pull request to trigger seat assignment. Otherwise, ask an organization administrator to assign a seat through the subscription management page at https://app.coderabbit.ai/login. Comment |
There was a problem hiding this comment.
Pull request overview
Esta PR expande o RustHash para suportar um catálogo amplo de algoritmos de hash/checksum, com execução local via Rust+WASM e processamento assíncrono em Web Worker, além de adicionar uma UI “Explorer” em React com busca/filtros e informações de segurança em português.
Changes:
- Adiciona múltiplos hashers incrementais no módulo Rust/WASM (SHA-1/2/3, SHAKE, BLAKE2/3, RIPEMD-160, Whirlpool, SM3, CRC/Adler, FNV, Murmur3, xxHash, SipHash, Luhn/Verhoeff/Damm).
- Introduz um registry (PT-BR) com metadados, recomendações e classificação de segurança para 100+ algoritmos.
- Atualiza o worker e a UI para calcular/exibir resultados dinamicamente, com filtros, pesquisa e modais informativos, além de novos estilos (badges/ícones).
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| rust/src/lib.rs | Novos wrappers WASM para diversos algoritmos e checksums, incluindo testes adicionais. |
| rust/Cargo.toml | Adiciona dependências de crates de hashing/checksum para suportar os novos algoritmos. |
| rust/Cargo.lock | Atualiza lockfile para refletir novas dependências. |
| frontend/src/hash.worker.ts | Generaliza hashing via worker para múltiplos algoritmos (texto e arquivo). |
| frontend/src/hashRegistry.ts | Introduz catálogo/metadata em PT-BR para algoritmos e status de implementação. |
| frontend/src/App.tsx | UI dinâmica com explorer, busca/filtros, modais informativos e labels em português. |
| frontend/src/styles.css | Estilos para badges de segurança, ícones e modal/explorer. |
Suppressed comments (2)
frontend/src/hash.worker.ts:170
- Após filtrar hashers no caminho de arquivo, a finalização também precisa iterar a mesma lista (senão tentará finalizar instâncias não criadas). Além disso, como os algoritmos decimais foram excluídos, a ramificação específica para eles não é mais necessária no caminho
HASH_FILE.
// Finalize all hashes
const results = {} as Record<string, string>;
for (const k of algoKeys) {
const outBytes = instances[k].finalize();
if (k === 'luhn' || k === 'verhoeff' || k === 'damm') {
frontend/src/App.tsx:674
- O botão "ℹ️" no Explorer também deveria ter
aria-label(otitlenão é um substituto confiável para leitores de tela).
<button
className="info-icon-btn"
style={{ background: 'transparent', border: 'none', cursor: 'pointer', fontSize: '1.1rem' }}
onClick={() => setActiveInfoAlgo(algo)}
title="Detalhes e Recomendações"
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| category: 'Fuzzy/Similaridade', | ||
| description: 'Hash de assinatura anti-spam projetado para medir a similaridade entre e-mails.', | ||
| securityLevel: 'Não aplicável', | ||
| recommendation: 'Útil em sysetmas legados anti-spam baseados em heurística.', |
| case 'Seguro': | ||
| return { text: 'SEGURO', className: 'badge-secure' }; | ||
| case 'Fraco/Inseguro': | ||
| return { text: 'FRACASSO/VULNERÁVEL', className: 'badge-weak' }; |
| use adler::Adler32; | ||
| use std::hash::Hasher as _; |
| pub fn new() -> SipHashHasher { | ||
| use siphasher::sip::SipHasher13; | ||
| // Seed with 0,0 keys | ||
| SipHashHasher(SipHasher13::new_with_keys(0, 0)) | ||
| } |
| // Instantiate all hashers | ||
| const instances = {} as Record<AlgoKey, any>; | ||
| for (const k of algoKeys) { | ||
| instances[k] = new hashersConfig[k](); | ||
| } |
| .info-icon-btn:hover { | ||
| transform: scale(1.2); | ||
| } |
| <button | ||
| className="info-icon-btn" | ||
| title="Ver detalhes do algoritmo" | ||
| onClick={() => { | ||
| const match = hashAlgorithms.find(a => a.name === label); | ||
| if (match) setActiveInfoAlgo(match); | ||
| }} | ||
| > |
| <button | ||
| style={{ |
| name: 'SipHash', | ||
| category: 'Fast/Non-Cryptographic', | ||
| description: 'Hash com chave de alta velocidade projetado para evitar ataques de colisão em tabelas de hash (Hash DoS).', | ||
| securityLevel: 'Seguro', | ||
| recommendation: 'Altamente recomendado como hash padrão de dicionários em linguagens modernas (Rust, Python).', |
This PR delivers a comprehensive implementation of 110+ hash algorithms, including active local WASM-based computation for over 30 of them. Highlights include:
frontend/src/hashRegistry.ts): Complete catalog with categorizations, descriptions, safety warnings, and citations in Portuguese.rust/src/lib.rs): Built incremental WASM bindings for SHA-2, SHA-3, SHAKE, BLAKE2, RIPEMD-160, Whirlpool, SM3, Adler-32, CRC-32, FNV, xxHash, SipHash, Luhn, Verhoeff, and Damm.frontend/src/hash.worker.ts): Supports parallel background hashing of files and strings without blocking the main UI thread.frontend/src/App.tsx&styles.css): Features category filters, a robust search bar, interactive informational modals, dynamic compare-matching, and a detailed security warning footer.PR created automatically by Jules for task 9610711966805404357 started by @erikraft
Summary by CodeRabbit