MCPcopy Index your code
hub / github.com/LasCC/HackTools / handleEncode

Function handleEncode

src/components/encoding/Hashing.tsx:27–50  ·  view source on GitHub ↗
( hashtype: string )

Source from the content-addressed store, hash-verified

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 };

Callers 1

HashEncodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected