GeneralPurposeBitFlag.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4. * This file is part of the nelexa/zip package.
  5. * (c) Ne-Lexa <https://github.com/Ne-Lexa/php-zip>
  6. * For the full copyright and license information, please view the LICENSE
  7. * file that was distributed with this source code.
  8. */
  9. namespace PhpZip\Constants;
  10. interface GeneralPurposeBitFlag
  11. {
  12. /**
  13. * General Purpose Bit Flag mask for encrypted data.
  14. * Bit 0: If set, indicates that the file is encrypted.
  15. */
  16. public const ENCRYPTION = 1 << 0;
  17. /**
  18. * Compression Flag Bit 1 for method Deflating.
  19. *
  20. * Bit 2 Bit 1
  21. * 0 0 Normal compression
  22. * 0 1 Maximum compression
  23. * 1 0 Fast compression
  24. * 1 1 Super Fast compression
  25. *
  26. * @see GeneralPurposeBitFlag::COMPRESSION_FLAG2
  27. */
  28. public const COMPRESSION_FLAG1 = 1 << 1;
  29. /**
  30. * Compression Flag Bit 2 for method Deflating.
  31. *
  32. * Bit 2 Bit 1
  33. * 0 0 Normal compression
  34. * 0 1 Maximum compression
  35. * 1 0 Fast compression
  36. * 1 1 Super Fast compression
  37. *
  38. * @see GeneralPurposeBitFlag::COMPRESSION_FLAG1
  39. */
  40. public const COMPRESSION_FLAG2 = 1 << 2;
  41. /**
  42. * General Purpose Bit Flag mask for data descriptor.
  43. *
  44. * Bit 3: If this bit is set, the fields crc-32, compressed
  45. * size and uncompressed size are set to zero in the
  46. * local header. The correct values are put in the data
  47. * descriptor immediately following the compressed data.
  48. */
  49. public const DATA_DESCRIPTOR = 1 << 3;
  50. /**
  51. * General Purpose Bit Flag mask for strong encryption.
  52. *
  53. * Bit 6: Strong encryption.
  54. * If this bit is set, you MUST set the version needed to extract
  55. * value to at least 50 and you MUST also set bit 0.
  56. * If AES encryption is used, the version needed to extract value
  57. * MUST be at least 51.
  58. */
  59. public const STRONG_ENCRYPTION = 1 << 6;
  60. /**
  61. * General Purpose Bit Flag mask for UTF-8.
  62. *
  63. * Bit 11: Language encoding flag (EFS).
  64. * If this bit is set, the filename and comment fields
  65. * for this file MUST be encoded using UTF-8. (see APPENDIX D)
  66. */
  67. public const UTF8 = 1 << 11;
  68. }