Comments (2)
That is an interesting idea. I tried to implement the first part of it.
However, I'm not sure about the second part (suggestion to write the checksum only in some cases). It might make things more complicated for just saving 8 byte on some files. What do you mean by "size". Is it the number of elements or the number of bytes (of the serialized file)? The first might not correspond to large file size and (I'm note sure but think) the latter is currently not written.
I've another idea: Should we add also a "version number" of the data structure, since the checksum does not protect to load an "old" sdsl-object. This is a problem in the (rare?) case that the serialization methods changed but the name of the class didn't.
from sdsl-lite.
Instead of changing anything, I've added the new functions 'store_to_checked_file' and 'load_from_checked_file'. 'store_to_checked_file' behaves like 'store_to_file' but produce an additional file (with prefix _check) that contains a 64bit hash value of the classname. Similarly, 'load_from_checked_file' behaves like 'load_from_file' but verifies first, whether the checksum is correct. The advantage is backward compatibility - old files can still be loaded.
However, it might be a better to add an additional (optional) bool parameter to 'store_to_file' and 'load_from_file' instead of the adding new functions? What you you think?
from sdsl-lite.
Related Issues (20)
- Decompression of Integer Vectors
- <HTML_FORMAT> in sdsl tutorial expl-20 can't be visualized
- block compression
- Faster than libdivsufsort new library, impressive gains : libsais
- Is the technology in your paper(Improved and extended locating functionality on compressed suffix arrays,2015) used in this library?
- old http links in rrr_vector benchmark
- Using compressed integer vectors
- Maximum limit on reference and query string length
- New release for conda
- 2.1.1 release missing pkgconfig .pc for libsdsl.a
- construct_lcp.cpp KEY_TEXT warning
- problem with serialization of a sd_vector HOT 2
- Can I use the clang compiler for seqwish? HOT 1
- .gitignore HOT 1
- de5db3c8beeea262c163c94fcacd938e57967ece HOT 1
- Linking SDSL into a project
- The code uses divsufsort64.h that isn't installed by the latest revision of libdivsufsort
- Please do not install googletest
- Unclear how to run tests
- 'bits::write_int' function definition mismatches its declaration
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdsl-lite.