Skip to content

Commit

Permalink
add anchor checksum
Browse files Browse the repository at this point in the history
  • Loading branch information
Moelf committed Jul 1, 2024
1 parent dd3c06c commit e668c84
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/RNTuple/bootstrap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ end
function ROOT_3a3a_Experimental_3a3a_RNTuple(io, tkey::TKey, refs)
local_io = datastream(io, tkey)
skip(local_io, 6)
_before_anchor = position(local_io)
anchor_checksum = xxh3_64(read(local_io, 2*4 + 6*8))
seek(local_io, _before_anchor)
anchor = ROOT_3a3a_Experimental_3a3a_RNTuple(;
fVersionEpoch = readtype(local_io, UInt16),
fVersionMajor = readtype(local_io, UInt16),
Expand All @@ -30,6 +33,9 @@ function ROOT_3a3a_Experimental_3a3a_RNTuple(io, tkey::TKey, refs)
fChecksum = readtype(local_io, UInt64),
)

@assert anchor.fChecksum == anchor_checksum "RNtuple anchor checksum doesn't match"


header_bytes = decompress_bytes(read_seek_nb(io, anchor.fSeekHeader, anchor.fNBytesHeader), anchor.fLenHeader)
header_io = IOBuffer(header_bytes)
header = _rntuple_read(header_io, RNTupleEnvelope{RNTupleHeader})
Expand Down

0 comments on commit e668c84

Please sign in to comment.