Use raw byte array as input of sha1

Aperta
#1,058 1 commento 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript
Ambito
cryptography

Direzione di ricerca

Start by tracing the forge.md.sha1.create().update() entry point used in the examples and inspect how update handles string input. Verify whether the raw byte array example can produce the same digest as the UTF-8 string, then add or update coverage for equivalent byte-array and string inputs.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I cannot figure out any way to feed straight byte arrays to sha1.

My understanding is that those two lines should return identical results

forge.md.sha1.create().update('hello', 'utf8').digest().toHex()
forge.md.sha1.create().update([104,101,108,108,111]).digest().toHex()

ASCII encoding of hello is [104, 101, 108, 108, 111]. How can I feed this raw byte array directly into sha1 and make it understand it as such ?

Lingua principale
JavaScript
Stelle
5.4k
Fork
874
Merge medio
3m
PR unite (30g)
6

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di digitalbazaar/forge

Tutte le issue di digitalbazaar/forge

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.