logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

File::KDBX::IO::HashBlock - Hash block stream IO handle

Attributes

algorithm
       Digest algorithm in hash-blocking the stream (default: "SHA-256")

   block_size
       Desired block size when writing (default: $File::KDBX::IO::HashBlock::BLOCK_SIZE or 1,048,576 bytes)

Author

       Charles McGarvey <ccm@cpan.org>

Bugs

       Please    report    any    bugs     or     feature     requests     on     the     bugtracker     website
       <https://github.com/chazmcgarvey/File-KDBX/issues>

       When  submitting  a  bug  or request, please include a test-file or a patch to an existing test-file that
       illustrates the bug or desired feature.

Description

       Writing to a hash-block handle will transform the data into a series of blocks. Each block is hashed, and
       the hash is included with the block in the stream.

       Reading from a handle, each hash block will be verified as the blocks are disassembled back into a data
       stream.

       This format helps ensure data integrity of KDBX3 files.

       Each block is encoded thusly:

       •   Block index - Little-endian unsigned 32-bit integer, increments starting with 0

       •   Hash - 32 bytes

       •   Block size - Little-endian unsigned 32-bit (counting only the data)

       •   Data - String of bytes

       The  terminating  block  is  an  empty block where hash is 32 null bytes, block size is 0 and there is no
       data.

Methods

new
           $fh = File::KDBX::IO::HashBlock->new(%attributes);
           $fh = File::KDBX::IO::HashBlock->new($fh, %attributes);

       Construct a new hash-block stream IO handle.

Name

       File::KDBX::IO::HashBlock - Hash block stream IO handle

Version

       version 0.906

See Also