REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.30 KB
Close
//proc/thread-self/root/opt/alt/ruby21/lib64/ruby/2.1.0/rubygems/package/digest_io.rb
Text
Base64
## # IO wrapper that creates digests of contents written to the IO it wraps. class Gem::Package::DigestIO ## # Collected digests for wrapped writes. # # { # 'SHA1' => #<OpenSSL::Digest: [...]>, # 'SHA512' => #<OpenSSL::Digest: [...]>, # } attr_reader :digests ## # Wraps +io+ and updates digest for each of the digest algorithms in # the +digests+ Hash. Returns the digests hash. Example: # # io = StringIO.new # digests = { # 'SHA1' => OpenSSL::Digest.new('SHA1'), # 'SHA512' => OpenSSL::Digest.new('SHA512'), # } # # Gem::Package::DigestIO.wrap io, digests do |digest_io| # digest_io.write "hello" # end # # digests['SHA1'].hexdigest #=> "aaf4c61d[...]" # digests['SHA512'].hexdigest #=> "9b71d224[...]" def self.wrap io, digests digest_io = new io, digests yield digest_io return digests end ## # Creates a new DigestIO instance. Using ::wrap is recommended, see the # ::wrap documentation for documentation of +io+ and +digests+. def initialize io, digests @io = io @digests = digests end ## # Writes +data+ to the underlying IO and updates the digests def write data result = @io.write data @digests.each do |_, digest| digest << data end result end end
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 6
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
tar_reader
DIR
-
drwxr-xr-x
2024-03-03 22:43:11
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
digest_io.rb
1.30 KB
lrw-r--r--
2012-11-29 06:52:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
old.rb
3.78 KB
lrw-r--r--
2023-07-26 14:19:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
tar_header.rb
5.28 KB
lrw-r--r--
2014-02-06 02:59:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
tar_reader.rb
2.37 KB
lrw-r--r--
2012-11-29 06:52:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
tar_test_case.rb
3.48 KB
lrw-r--r--
2013-09-14 08:59:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
tar_writer.rb
6.49 KB
lrw-r--r--
2013-09-14 08:59:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).