File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed
Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { FunctionComponent } from 'react';
22
33export const Footer : FunctionComponent = ( ) => {
44 return < >
5- < footer className = "my-2 pt-2 text-muted text-center text-small" >
5+ < footer className = "my-2 pt-2 text-white text-center text-small" >
66 Made with < span role = "img" aria-label = "heart" > ❤</ span > ️ and < span role = "img" aria-label = "coffee" > ☕️</ span >
77 < br />
88 < span role = "img" > ©</ span > 2019 - 2023 < a target = { '_blank' } rel = { 'noreferrer' } href = { 'https://www.rinne.info/' } >
Original file line number Diff line number Diff line change @@ -14,4 +14,10 @@ describe('generateHash', () => {
1414
1515 expect ( result ) . toBe ( 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' ) ;
1616 } ) ;
17+
18+ it ( 'should return a valid string with special characters' , ( ) => {
19+ const result = generateHash ( 'foo' , '<html#>' , 'baz' ) ;
20+
21+ expect ( result ) . toBe ( 'b7385df3b782339b66400089d41a142d4e007d84c94fb68397d7f4fb82e74f9b' ) ;
22+ } ) ;
1723} ) ;
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ import { Buffer } from 'buffer';
1515 * @param salt
1616 */
1717export const generateHash = ( userName : string , password : string , salt : string ) => {
18- const uint8array = new TextEncoder ( ) . encode ( password + salt + userName ) ;
18+ const uint8array = new TextEncoder ( ) . encode ( encodeURI ( password ) + salt + userName ) ;
1919 const hash = new sha256 . Hash ( ) ;
2020
2121 hash . update ( uint8array ) ;
You can’t perform that action at this time.
0 commit comments