A c # Algorithm Analysis Solution

Source: Internet
Author: User
RecentlyAlgorithmThe process is not complex, but the corresponding inverse algorithm has not been found for a long time. It is released here, hoping that some people can provide ideas,
If you have specificCodeImplementation is the best.
Implement the public static string recalc (byte [] buffer1) method to ensure
If (text = text1) console. writeline ("OK ");
You can. 1 String text = " 5uytshz0pl4q3rb26fd " ;
2 Byte [] Mydata = New   Byte [ 12 ];
3 Calc_1 (text, mydata );
4 String text1 = Recalc (data );
5 If (Text = Text1) console. writeline ( " OK " );
6
7 // Implement the following method to meet the preceding conditions
8 Public   Static String recalc ( Byte [] Buffer1) {
9Return "";
10}

11
12 Public   Static   Void Calc ( String Text1, Byte [] Buffer1)
13 {
14 Ushort Num1 =   11 ;
15 Uint Num2 =   0 ;
16 Uint Num3 =   0 ;
17 Int Num4 =   0 ;
18 While (Num2 < Buffer1.length) && (Num3 <   90 ))
19 {
20 Uint Num5 = Calcnum (text1 [num4 ++ ]);
21 If (Num5 =   0 xFFFF )
22 {
23Throw NewException ("Error");
24}

25 Num5 = Num5 < (Num1 &   0x1f );
26 Buffer1 [num2] = Convert. tobyte (buffer1 [num2] | (Num5 &   0xff00 ) >   8 ));
27 Buffer1 [num2 +   1 ] = Convert. tobyte (buffer1 [num2 +   1 ] | (Num5 &   0xff ));
28 If (Num1 <   8 )
29 {
30Num1+ = 3;
31Num2++;
32}

33 Else
34 {
35Num1-= 5;
36}

37 Num3 + =   5 ;
38 }

39 }

40
41 Public   Static   Uint Calcnum ( Char C) {
42 String data = " 6hc3qbw9k2ful8xj4p0tn5deaz1yr7vg " ;
43 For ( Int I = 0 ; I < Data. length; I ++ ) {
44If(Data [I]=C)Return(Uint) I;
45}

46 Return   0 xFFFF ;
47 }

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.