| 25 | resolvehashname( type.key ); |
| 26 | }; |
| 27 | const handleEncode = ( hashtype: string ) => { |
| 28 | let output: string; |
| 29 | switch ( hashtype ) { |
| 30 | case 'MD5': |
| 31 | output = MD5( input, undefined ).toString(); |
| 32 | break; |
| 33 | case 'SHA1': |
| 34 | output = SHA1( input, undefined ).toString(); |
| 35 | break; |
| 36 | case 'SHA256': |
| 37 | output = SHA256( input, undefined ).toString(); |
| 38 | break; |
| 39 | case 'SHA512': |
| 40 | output = SHA512( input, undefined ).toString(); |
| 41 | break; |
| 42 | case 'SM3': |
| 43 | output = Sm3( input ); |
| 44 | break; |
| 45 | default: |
| 46 | // If the hashtype is not recognized, return an empty string |
| 47 | output = ''; |
| 48 | } |
| 49 | setOutput( output ); |
| 50 | }; |
| 51 | const successInfoHashing = () => { |
| 52 | message.success( 'Your hash has been copied successfully !' ); |
| 53 | }; |