GeneralPurposeBitFlag.php 2.0 KB

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