private void AppendBinString(string bin, int bitLength) { if (bin.Length > bitLength) throw new Exception("len is too short"); var add = bitLength - bin.Length; for (int i = 0; i < add; i++) { BinString.Append('0'); } BinString.Append(bin); }