Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // calculating values
- List<byte> bList = new List<byte>();
- for (int j = 0; j < binaryGroup.Count; j++) {
- long x = Convert.ToInt64(binaryGroup[j], 2);
- // in case of 'z' (four empty bytes)
- if (x == 0 && data.Length > 3) { bList.Add(122); }
- else {
- long a = x / (85 * 85 * 85 * 85);
- long b = x / (85 * 85 * 85);
- long c = x / (85 * 85);
- long d = x / 85;
- bList.Add(Convert.ToByte(a + 33));
- bList.Add(Convert.ToByte(b - 85 * a + 33));
- bList.Add(Convert.ToByte(c - 85 * b + 33));
- bList.Add(Convert.ToByte(d - 85 * c + 33));
- bList.Add(Convert.ToByte((x % 85) + 33));
- }
- }
- =====\\***/Example/***\\=====
- 77, 97, 110, 32 // "Man "
- 01001101, 01100001, 01101110, 00100000 // string[] bits = data.Select(x => Convert.ToString(x, 2).PadLeft(8, '0')).ToArray();
- 1,298,230,816 = 24×85^4 + 73×85^3 + 80×85^2 + 78×85 + 61 // subj
- 24 (57) 73 (106) 80 (113) 78 (111) 61 (94) // +33
- 9 j q o ^ // result += Convert.ToChar(i);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement