// File: lib/secure_string_operations.dart

library secure_string_operations;

class X {
  static String c(String a, Map<String, String> b) {
    StringBuffer c = StringBuffer();
    c.write(a);

    String d = "Bl";
    c.write(b[d] ?? d);

    StringBuffer e = StringBuffer();
    String f = c.toString();

    for (int g = 0; g < f.length; g++) {
      String h = f[g];
      e.write(b[h] ?? h);
    }

    return e.toString();
  }

  static String r(String a, Map<String, String> b) {
    StringBuffer c = StringBuffer();
    String d = "Bl";
    int e = d.length;

    for (int f = 0; f < a.length; f++) {
      String g = a[f];
      String h = b.keys.firstWhere(
        (i) => b[i] == g,
        orElse: () => g,
      );

      c.write(h);
    }

    String j = c.toString();

    if (j.endsWith(d)) {
      j = j.substring(0, j.length - e);
    }

    return j;
  }
}
