mirror of
https://github.com/bitwarden/server.git
synced 2024-11-21 12:05:42 +01:00
Remove unused qwerty helpers (#2149)
This commit is contained in:
parent
66de2f34f5
commit
2979fde0f7
@ -28,12 +28,6 @@ namespace Bit.Core.Utilities
|
||||
private static readonly DateTime _max = new DateTime(9999, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
private static readonly Random _random = new Random();
|
||||
private static string _version;
|
||||
private static readonly string _qwertyDvorakMap = "-=qwertyuiop[]asdfghjkl;'zxcvbnm,./_+QWERTYUIO" +
|
||||
"P{}ASDFGHJKL:\"ZXCVBNM<>?";
|
||||
private static readonly string _dvorakMap = "[]',.pyfgcrl/=aoeuidhtns-;qjkxbmwvz{}\"<>PYFGC" +
|
||||
"RL?+AOEUIDHTNS_:QJKXBMWVZ";
|
||||
private static readonly string _qwertyColemakMap = "qwertyuiopasdfghjkl;zxcvbnmQWERTYUIOPASDFGHJKL:ZXCVBNM";
|
||||
private static readonly string _colemakMap = "qwfpgjluy;arstdhneiozxcvbkmQWFPGJLUY:ARSTDHNEIOZXCVBKM";
|
||||
private static readonly string CloudFlareConnectingIp = "CF-Connecting-IP";
|
||||
private static readonly string RealIp = "X-Real-IP";
|
||||
|
||||
@ -477,26 +471,6 @@ namespace Bit.Core.Utilities
|
||||
return _version;
|
||||
}
|
||||
|
||||
public static string Dvorak2Qwerty(string value)
|
||||
{
|
||||
return Other2Qwerty(value, _dvorakMap, _qwertyDvorakMap);
|
||||
}
|
||||
|
||||
public static string Colemak2Qwerty(string value)
|
||||
{
|
||||
return Other2Qwerty(value, _colemakMap, _qwertyColemakMap);
|
||||
}
|
||||
|
||||
private static string Other2Qwerty(string value, string otherMap, string qwertyMap)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
foreach (var c in value)
|
||||
{
|
||||
sb.Append(otherMap.IndexOf(c) > -1 ? qwertyMap[otherMap.IndexOf(c)] : c);
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public static string SanitizeForEmail(string value, bool htmlEncode = true)
|
||||
{
|
||||
var cleanedValue = value.Replace("@", "[at]");
|
||||
|
Loading…
Reference in New Issue
Block a user