public ActionResult Index(FormCollection form) { Encoding encoding = new Base32Encoding(); ViewBag.Encoded = encoding.GetString(Encoding.UTF8.GetBytes(form["plainText"])); return(View()); }
private static Uri GetUri(byte[] secret) { Encoding encoding = new Base32Encoding(); UriBuilder builder = new UriBuilder(); builder.Host = "totp"; builder.Path = "testme"; builder.Query = "secret=" + encoding.GetString(secret); builder.Scheme = "otpauth"; return(builder.Uri); }