File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
static/lessons/cryptoBreaker Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -137,11 +137,15 @@ let base64Enc = (mes) => {
137137let hashEnc = ( mes ) => {
138138 let words = mes . split ( " " ) ;
139139 let hashedWords = [ ] ;
140+ let hashes = [ ] ;
140141 for ( let word of words ) {
141142 let hash = crypto . createHash ( 'md5' ) . update ( word ) . digest ( 'hex' ) ;
142- hashedWords . push ( hash ) ;
143+ if ( hashedWords . indexOf ( word ) === - 1 ) {
144+ hashedWords . push ( word ) ;
145+ hashes . push ( hash ) ;
146+ }
143147 }
144- return getRes ( mes , hashedWords . join ( "\n" ) ) ;
148+ return getRes ( hashedWords . join ( " " ) , hashes . join ( "\n" ) ) ;
145149}
146150
147151let xorEnc = ( message ) => {
Original file line number Diff line number Diff line change 4040 "name" :" One-Way Hash" ,
4141 "description" : " crypto_hash.md" ,
4242 "type" :" quiz" ,
43- "mission" :" Find the text by cracking the digest of each word." ,
43+ "mission" :" Find the text by cracking the digest of each word. Make sure the words are entered in the same order, separated by spaces. " ,
4444 "codeBlockIds" :[]
4545 },
4646 {
You can’t perform that action at this time.
0 commit comments