daily pastebin goal
18%
SHARE
TWEET

Untitled

a guest Mar 18th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // calculating values
  2. List<byte> bList = new List<byte>();
  3. for (int j = 0; j < binaryGroup.Count; j++) {
  4.     long x = Convert.ToInt64(binaryGroup[j], 2);
  5.     // in case of 'z' (four empty bytes)
  6.     if (x == 0 && data.Length > 3) { bList.Add(122); }
  7.  
  8.     else {
  9.         long a = x / (85 * 85 * 85 * 85);
  10.         long b = x / (85 * 85 * 85);
  11.         long c = x / (85 * 85);
  12.         long d = x / 85;
  13.         bList.Add(Convert.ToByte(a + 33));
  14.         bList.Add(Convert.ToByte(b - 85 * a + 33));
  15.         bList.Add(Convert.ToByte(c - 85 * b + 33));
  16.         bList.Add(Convert.ToByte(d - 85 * c + 33));
  17.         bList.Add(Convert.ToByte((x % 85) + 33));
  18.     }
  19. }
  20.  
  21. =====\\***/Example/***\\=====
  22. 77, 97, 110, 32 // "Man "
  23. 01001101, 01100001, 01101110, 00100000 // string[] bits = data.Select(x => Convert.ToString(x, 2).PadLeft(8, '0')).ToArray();
  24. 1,298,230,816 = 24×85^4 + 73×85^3 + 80×85^2 + 78×85 + 61 // subj
  25. 24 (57)     73 (106)    80 (113)    78 (111)    61 (94) // +33
  26. 9   j   q   o   ^ // result += Convert.ToChar(i);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top