You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.7 KiB

  1. //using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace Apewer.Internals
  5. {
  6. internal class Constant
  7. {
  8. #region Byte[]
  9. /// <summary>空字节数组。</summary>
  10. public static readonly byte[] EmptyBytes = new byte[0];
  11. /// <summary>UTF-8 BOM。</summary>
  12. public static byte[] Bom { get => new byte[] { 0xEF, 0xBB, 0xBF }; }
  13. #endregion
  14. #region String
  15. /// <summary>空字符串。</summary>
  16. public const string EmptyString = "";
  17. /// <summary>换行符,由 ASCII 13 和 ASCII 10 组成。</summary>
  18. public const string LineFeed = "\r\n";
  19. /// <summary>空白半角字符。</summary>
  20. public const string BlankDbcCaseChars = " \n\r\t\b\f";
  21. /// <summary>空白全角字符。</summary>
  22. public const string BlankSbcCaseChars = " ";
  23. /// <summary>所有易识别的字符,包含大写字母和数字。</summary>
  24. public const string LucidCollection = "3456789acefhknpstwxyz";
  25. /// <summary>所有 GUID 中的字符,包含字母、数字和连字符。</summary>
  26. public const string GuidCollection = "0123456789ABCDEFabcdef-";
  27. /// <summary>所有主键字符。</summary>
  28. public const string KeyCollection = "0123456789abcdefghijklmnopqrstuvwxyz";
  29. /// <summary>所有十六进制字符。</summary>
  30. public const string HexCollection = "0123456789abcdef";
  31. /// <summary>所有数字(ASCII 48 ~ 57)。</summary>
  32. public const string NumberCollection = "0123456789";
  33. /// <summary>所有数字(ASCII 48 ~ 57)。</summary>
  34. public const string NumericCollection = "0123456789";
  35. /// <summary>所有小写字母(ASCII 97 ~ 122)。</summary>
  36. public const string LowerCollection = "abcdefghijklmnopqrstuvwxyz";
  37. /// <summary>所有大写字母(ASCII 65 ~ 90)。</summary>
  38. public const string UpperCollection = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  39. /// <summary>所有字母。</summary>
  40. public const string LetterCollection = LowerCollection + UpperCollection;
  41. /// <summary>注入字符默认黑名单。</summary>
  42. public const string InjectDefaultBlackList = "\"'`\b\f\n\r\t\\/:*?<>|@";
  43. /// <summary>注入字符黑名单。</summary>
  44. public const string InjectJsonBlackList = "\\\"'\b\f\n\r\t/@";
  45. #endregion
  46. #region Preset Property
  47. /// <summary>TCP 传输缓冲区大小。</summary>
  48. public const int TcpBufferSize = 8191;
  49. /// <summary>默认的缓冲区容量。</summary>
  50. public const int DefaultBufferCapacity = 1024;
  51. #endregion
  52. }
  53. }