rubyzip/lib/zip/crypto/null_encryption.rb

46 lines
704 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2014-12-31 00:03:17 +08:00
module Zip
module NullEncryption
def header_bytesize
0
end
def gp_flags
0
end
end
class NullEncrypter < Encrypter
2014-12-31 00:03:17 +08:00
include NullEncryption
def header(_mtime)
2014-12-31 00:03:17 +08:00
''
end
def encrypt(data)
data
end
def data_descriptor(_crc32, _compressed_size, _uncomprssed_size)
''
end
2017-06-29 10:57:12 +08:00
def reset!; end
2014-12-31 00:03:17 +08:00
end
class NullDecrypter < Decrypter
2014-12-31 00:03:17 +08:00
include NullEncryption
def decrypt(data)
data
end
2017-06-29 10:57:12 +08:00
def reset!(_header); end
2014-12-31 00:03:17 +08:00
end
end
# Copyright (C) 2002, 2003 Thomas Sondergaard
# rubyzip is free software; you can redistribute it and/or
# modify it under the terms of the ruby license.