cdb-0.6.0/.gitignore010066400007640000764000000000221336436271100124700ustar0000000000000000target Cargo.lock cdb-0.6.0/.travis.yml010066400007640000764000000002211336436561300126160ustar0000000000000000language: rust sudo: false cache: cargo rust: - nightly - beta - stable os: - linux - osx matrix: allow_failures: - rust: nightly cdb-0.6.0/Cargo.toml.orig010066400007640000764000000006431336445655000134050ustar0000000000000000[package] name = "cdb" version = "0.6.0" authors = ["Bruce Guenter "] description = "Pure Rust library to read and write CDB files" homepage = "https://github.com/bruceg/cdb-rs" repository = "https://github.com/bruceg/cdb-rs" readme = "README.md" license = "Unlicense" [dependencies] filebuffer = "0.4" libc = "0.2.4" [dev-dependencies] criterion = "0.2" [[bench]] name = "cdb" harness = false cdb-0.6.0/Cargo.toml0000644000000017250000000000000076310ustar00# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g. crates.io) dependencies # # If you believe there's an error in this file please file an # issue against the rust-lang/cargo repository. If you're # editing this file be aware that the upstream Cargo.toml # will likely look very different (and much more reasonable) [package] name = "cdb" version = "0.6.0" authors = ["Bruce Guenter "] description = "Pure Rust library to read and write CDB files" homepage = "https://github.com/bruceg/cdb-rs" readme = "README.md" license = "Unlicense" repository = "https://github.com/bruceg/cdb-rs" [[bench]] name = "cdb" harness = false [dependencies.filebuffer] version = "0.4" [dependencies.libc] version = "0.2.4" [dev-dependencies.criterion] version = "0.2" cdb-0.6.0/LICENSE010064400007640000764000000022721264461407100115130ustar0000000000000000This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to cdb-0.6.0/README.md010066400007640000764000000007221336436561300117720ustar0000000000000000cdb ==== [![Crate](https://img.shields.io/crates/v/cdb.svg)](https://crates.io/crates/cdb) [![Build Status](https://travis-ci.org/bruceg/cdb.svg?branch=master)](https://travis-ci.org/bruceg/cdb) This library provides pure Rust support for reading and writing [CDB][cdb] files. A CDB file is a constant key-value on-disk hash table, designed for high-speed lookups. [cdb]: http://cr.yp.to/cdb.html [Documentation](https://docs.rs/cdb) ## License Public Domain cdb-0.6.0/benches/cdb.rs010066400007640000764000000026771336445326000132270ustar0000000000000000extern crate cdb; #[macro_use] extern crate criterion; use cdb::CDB; use criterion::Criterion; fn test_cdb() -> CDB { CDB::open("tests/test2.cdb").expect("Could not open tests/test2.cdb") } fn reader_benchmark(c: &mut Criterion) { c.bench_function("CDB::open", |b| b.iter(|| { test_cdb(); })); c.bench_function("CDB::find", |b| { let cdb = test_cdb(); b.iter(|| cdb.find(b"two")) }); c.bench_function("CDB::find long", |b| { let cdb = test_cdb(); b.iter(|| cdb.find(b"this key will be split across two reads")) }); c.bench_function("CDB::find result", |b| { let cdb = test_cdb(); b.iter(|| cdb.find(b"two").next().unwrap()) }); c.bench_function("CDB::find result loop", |b| { let cdb = test_cdb(); b.iter(|| for result in cdb.find(b"one") { result.unwrap(); }) }); c.bench_function("CDB::open + find result loop", |b| b.iter(|| { let cdb = test_cdb(); for result in cdb.find(b"one") { result.unwrap(); } })); c.bench_function("CDB::iter result loop", |b| { let cdb = test_cdb(); b.iter(|| for result in cdb.iter() { result.unwrap(); }) }); c.bench_function("CDB::open + iter result loop", |b| b.iter(|| { let cdb = test_cdb(); for result in cdb.iter() { result.unwrap(); } })); } criterion_group!(benches, reader_benchmark); criterion_main!(benches); cdb-0.6.0/cdb.txt010066400007640000764000000030360705233071300117730ustar0000000000000000A structure for constant databases 19960914 Copyright 1996 D. J. Bernstein, djb@pobox.com A cdb is an associative array: it maps strings (``keys'') to strings (``data''). A cdb contains 256 pointers to linearly probed open hash tables. The hash tables contain pointers to (key,data) pairs. A cdb is stored in a single file on disk: +----------------+---------+-------+-------+-----+---------+ | p0 p1 ... p255 | records | hash0 | hash1 | ... | hash255 | +----------------+---------+-------+-------+-----+---------+ Each of the 256 initial pointers states a position and a length. The position is the starting byte position of the hash table. The length is the number of slots in the hash table. Records are stored sequentially, without special alignment. A record states a key length, a data length, the key, and the data. Each hash table slot states a hash value and a byte position. If the byte position is 0, the slot is empty. Otherwise, the slot points to a record whose key has that hash value. Positions, lengths, and hash values are 32-bit quantities, stored in little-endian form in 4 bytes. Thus a cdb must fit into 4 gigabytes. A record is located as follows. Compute the hash value of the key in the record. The hash value modulo 256 is the number of a hash table. The hash value divided by 256, modulo the length of that table, is a slot number. Probe that slot, the next higher slot, and so on, until you find the record or run into an empty slot. The cdb hash function is ``h = ((h << 5) + h) ^ c'', with a starting hash of 5381. cdb-0.6.0/src/hash.rs010066400007640000764000000007131264275233300125700ustar0000000000000000const HASHSTART: u32 = 0x1505; pub fn add(h: u32, c: u8) -> u32 { //(h + (h << 5)) ^ (c as u32) h.wrapping_shl(5).wrapping_add(h) ^ (c as u32) } pub fn hash(buf: &[u8]) -> u32 { let mut h = HASHSTART; for c in buf { h = add(h, *c); } h } #[test] fn samples() { assert_eq!(hash(b""), 0x0001505); assert_eq!(hash(b"Hello, world!"), 0x564369e8); assert_eq!(hash(b"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), 0x40032705); } cdb-0.6.0/src/lib.rs010066400007640000764000000025641336443464400124250ustar0000000000000000//! This crate provides support for reading and writing //! [CDB](https://cr.yp.to/cdb.html) files. A CDB is a "constant //! database" that acts as an on-disk associative array mapping keys to //! values, allowing multiple values for each key. It provides for fast //! lookups and low overheads. A constant database has no provision for //! updating, only rewriting from scratch. //! //! # Examples //! //! Reading a set of records: //! //! ``` //! let cdb = cdb::CDB::open("tests/test1.cdb").unwrap(); //! //! for result in cdb.find(b"one") { //! println!("{:?}", result.unwrap()); //! } //! ``` //! //! Creating a database with safe atomic updating: //! //! ```no_run //! fn main() -> std::io::Result<()> { //! let mut cdb = cdb::CDBWriter::create("temporary.cdb")?; //! cdb.add(b"one", b"Hello, ")?; //! cdb.add(b"one", b"world!\n")?; //! cdb.add(b"two", &[1, 2, 3, 4])?; //! cdb.finish()?; //! Ok(()) //! } //! ``` //! //! # References //! //! * [D. J. Bernstein's original software](https://cr.yp.to/cdb.html) //! * [Constant Database (cdb) Internals](https://www.unixuser.org/~euske/doc/cdbinternals/index.html) //! * [Wikipedia](https://en.wikipedia.org/wiki/Cdb_(software)) extern crate filebuffer; mod uint32; mod hash; mod reader; mod writer; pub use reader::{CDB, CDBIter, CDBKeyValueIter, CDBValueIter, Result}; pub use writer::{CDBMake, CDBWriter}; cdb-0.6.0/src/reader.rs010066400007640000764000000157061336444767500131330ustar0000000000000000use filebuffer::FileBuffer; use std::io; use std::cmp::min; use std::path; use hash::hash; use uint32; pub use std::io::Result; const KEYSIZE: usize = 32; /// CDB file reader /// /// # Example /// /// ``` /// let cdb = cdb::CDB::open("tests/test1.cdb").unwrap(); /// /// for result in cdb.find(b"one") { /// println!("{:?}", result.unwrap()); /// } /// ``` pub struct CDB { file: FileBuffer, size: usize, } fn err_badfile() -> Result { Err(io::Error::new(io::ErrorKind::Other, "Invalid file format")) } impl CDB { /// Opens the named file and returns the CDB reader. /// /// # Examples /// /// ``` /// let cdb = cdb::CDB::open("tests/test1.cdb").unwrap(); /// ``` pub fn open>(filename: P) -> Result { let file = FileBuffer::open(&filename)?; if file.len() < 2048 + 8 + 8 || file.len() > 0xffffffff { return err_badfile(); } let size = file.len(); Ok(CDB { file, size, }) } fn read(&self, buf: &mut [u8], pos: u32) -> Result { let len = buf.len(); let pos = pos as usize; if pos + len > self.size { return err_badfile(); } buf.copy_from_slice(&self.file[pos .. pos + len]); Ok(len) } fn hash_table(&self, khash: u32) -> (u32, u32, u32) { let x = ((khash as usize) & 0xff) << 3; let (hpos, hslots) = uint32::unpack2(&self.file[x..x+8]); let kpos = if hslots > 0 { hpos + (((khash >> 8) % hslots) << 3) } else { 0 }; (hpos, hslots, kpos) } fn match_key(&self, key: &[u8], pos: u32) -> Result { let mut buf = [0 as u8; KEYSIZE]; let mut len = key.len(); let mut pos = pos; let mut keypos = 0; while len > 0 { let n = min(len, buf.len()); try!(self.read(&mut buf[..n], pos)); if buf[..n] != key[keypos..keypos+n] { return Ok(false); } pos += n as u32; keypos += n; len -= n; } Ok(true) } /// Find the first record with the named key. /// /// # Examples /// /// ``` /// let cdb = cdb::CDB::open("tests/test1.cdb").unwrap(); /// if let Some(record) = cdb.get(b"one") { /// println!("{:?}", record.unwrap()); /// } /// ``` pub fn get(&self, key: &[u8]) -> Option>> { self.find(key).next() } /// Find all records with the named key. The returned iterator /// produces each value associated with the key. /// /// # Examples /// /// ``` /// let cdb = cdb::CDB::open("tests/test1.cdb").unwrap(); /// /// for result in cdb.find(b"one") { /// println!("{:?}", result.unwrap()); /// } /// ``` pub fn find(&self, key: &[u8]) -> CDBValueIter { CDBValueIter::find(self, key) } /// Iterate over all the `(key, value)` pairs in the database. /// /// # Examples /// /// ``` /// let cdb = cdb::CDB::open("tests/test1.cdb").unwrap(); /// for result in cdb.iter() { /// let (key, value) = result.unwrap(); /// println!("{:?} => {:?}", key, value); /// } /// ```` pub fn iter(&self) -> CDBKeyValueIter { CDBKeyValueIter::start(&self) } } /// Type alias for [`CDBValueiter`](struct.CDBValueIter.html) pub type CDBIter<'a> = CDBValueIter<'a>; /// Iterator over a set of records in the CDB with the same key. /// /// See [`CDB::find`](struct.CDB.html#method.find) pub struct CDBValueIter<'a> { cdb: &'a CDB, key: Vec, khash: u32, kloop: u32, kpos: u32, hpos: u32, hslots: u32, dpos: u32, dlen: u32, } impl<'a> CDBValueIter<'a> { fn find(cdb: &'a CDB, key: &[u8]) -> Self { let khash = hash(key); let (hpos, hslots, kpos) = cdb.hash_table(khash); CDBValueIter { cdb: cdb, key: key.into_iter().map(|x| *x).collect(), khash: khash, kloop: 0, kpos: kpos, hpos: hpos, hslots: hslots, dpos: 0, dlen: 0, } } fn read_vec(&self) -> Result> { let mut result = vec![0; self.dlen as usize]; try!(self.cdb.read(&mut result[..], self.dpos)); Ok(result) } } macro_rules! iter_try { ( $e:expr ) => { match $e { Err(x) => { return Some(Err(x)); }, Ok(y) => y } } } impl<'a> Iterator for CDBValueIter<'a> { type Item = Result>; fn next(&mut self) -> Option { while self.kloop < self.hslots { let mut buf = [0 as u8; 8]; let kpos = self.kpos; iter_try!(self.cdb.read(&mut buf, kpos)); let (khash, pos) = uint32::unpack2(&buf); if pos == 0 { return None; } self.kloop += 1; self.kpos += 8; if self.kpos == self.hpos + (self.hslots << 3) { self.kpos = self.hpos; } if khash == self.khash { iter_try!(self.cdb.read(&mut buf, pos)); let (klen, dlen) = uint32::unpack2(&buf); if klen as usize == self.key.len() { if iter_try!(self.cdb.match_key(&self.key[..], pos + 8)) { self.dlen = dlen; self.dpos = pos + 8 + self.key.len() as u32; return Some(self.read_vec()); } } } } None } } /// Iterator over all the records in the CDB. /// /// See [`CDB::iter`](struct.CDB.html#method.iter) pub struct CDBKeyValueIter<'a> { cdb: &'a CDB, pos: u32, data_end: u32, } impl<'a> CDBKeyValueIter<'a> { fn start(cdb: &'a CDB) -> Self { let data_end = uint32::unpack(&cdb.file[0..4]).min(cdb.size as u32); Self { cdb, pos: 2048, data_end, } } } impl<'a> Iterator for CDBKeyValueIter<'a> { type Item = Result<(Vec, Vec)>; fn next(&mut self) -> Option { if self.pos + 8 >= self.data_end { None } else { let (klen, dlen) = uint32::unpack2(&self.cdb.file[self.pos as usize..self.pos as usize + 8]); if self.pos + klen + dlen >= self.data_end { Some(err_badfile()) } else { let kpos = (self.pos + 8) as usize; let dpos = kpos + klen as usize; let mut key = vec![0; klen as usize]; let mut value = vec![0; dlen as usize]; // Copied from CDB::read key.copy_from_slice(&self.cdb.file[kpos..kpos+klen as usize]); value.copy_from_slice(&self.cdb.file[dpos..dpos+dlen as usize]); self.pos += 8 + klen + dlen; Some(Ok((key, value))) } } } } cdb-0.6.0/src/uint32.rs010066400007640000764000000015631332612075000127650ustar0000000000000000use std::u32; pub fn unpack(data: &[u8]) -> u32 { assert!(data.len() >= 4); // Use u32::from_bytes when it stabilizes // Rust compiles this down to an efficient word copy (data[0] as u32) | ((data[1] as u32) << 8) | ((data[2] as u32) << 16) | ((data[3] as u32) << 24) } pub fn unpack2(buf: &[u8]) -> (u32, u32) { (unpack(&buf[0..4]), unpack(&buf[4..8])) } fn _pack(src: u32) -> [u8; 4] { // Use u32::to_bytes when it stabilizes // Rust compiles this down to an efficient word copy [ src as u8, (src >> 8) as u8, (src >> 16) as u8, (src >> 24) as u8 ] } pub fn pack(data: &mut [u8], src: u32) { assert!(data.len() >= 4); data[..4].copy_from_slice(&_pack(src)); } pub fn pack2(data: &mut [u8], src0: u32, src1: u32) { assert!(data.len() >= 8); pack(&mut data[0..4], src0); pack(&mut data[4..8], src1); } cdb-0.6.0/src/writer.rs010066400007640000764000000157071336436245400131750ustar0000000000000000use std::fs; use std::io; use std::io::prelude::*; use std::cmp::max; use std::path; use std::string; use std::iter; use hash::hash; use uint32; pub use std::io::Result; #[derive(Clone,Copy,Debug)] struct HashPos { hash: u32, pos: u32, } impl HashPos { fn pack(&self, buf: &mut [u8]) { uint32::pack2(buf, self.hash, self.pos); } } fn err_toobig() -> Result { Err(io::Error::new(io::ErrorKind::Other, "File too big")) } /// Base interface for making a CDB file. /// /// # Example /// /// ```no_run /// fn main() -> std::io::Result<()> { /// let file = std::fs::File::create("temporary.cdb")?; /// let mut cdb = cdb::CDBMake::new(file)?; /// cdb.add(b"one", b"Hello,")?; /// cdb.add(b"two", b"world!")?; /// cdb.finish()?; /// Ok(()) /// } /// ``` pub struct CDBMake { entries: Vec>, pos: u32, file: io::BufWriter, } impl CDBMake { /// Create a new CDB maker. pub fn new(file: fs::File) -> Result { let mut w = io::BufWriter::new(file); let buf = [0; 2048]; try!(w.seek(io::SeekFrom::Start(0))); try!(w.write(&buf)); Ok(CDBMake{ entries: iter::repeat(vec![]).take(256).collect::>(), pos: 2048, file: w, }) } fn pos_plus(&mut self, len: u32) -> Result<()> { if self.pos + len < len { err_toobig() } else { self.pos += len; Ok(()) } } fn add_end(&mut self, keylen: u32, datalen: u32, hash: u32) -> Result<()> { self.entries[(hash & 0xff) as usize].push(HashPos{ hash: hash, pos: self.pos }); try!(self.pos_plus(8)); try!(self.pos_plus(keylen)); try!(self.pos_plus(datalen)); Ok(()) } fn add_begin(&mut self, keylen: u32, datalen: u32) -> Result<()> { let mut buf = [0; 8]; uint32::pack2(&mut buf[0..8], keylen, datalen); try!(self.file.write(&buf)); Ok(()) } /// Add a record to the CDB file. pub fn add(&mut self, key: &[u8], data: &[u8]) -> Result<()> { if key.len() >= 0xffffffff || data.len() >= 0xffffffff { return Err(io::Error::new(io::ErrorKind::Other, "Key or data too big")); } try!(self.add_begin(key.len() as u32, data.len() as u32)); try!(self.file.write(key)); try!(self.file.write(data)); self.add_end(key.len() as u32, data.len() as u32, hash(&key[..])) } /// Set the permissions on the underlying file. pub fn set_permissions(&self, perm: fs::Permissions) -> Result<()> { self.file.get_ref().set_permissions(perm) } /// Finish writing to the CDB file and flush its contents. pub fn finish(mut self) -> Result<()> { let mut buf = [0; 8]; let maxsize = self.entries.iter().fold(1, |acc, e| max(acc, e.len() * 2)); let count = self.entries.iter().fold(0, |acc, e| acc + e.len()); if maxsize + count > (0xffffffff / 8) { return err_toobig(); } let mut table = vec![HashPos{ hash: 0, pos: 0 }; maxsize]; let mut header = [0 as u8; 2048]; for i in 0..256 { let len = self.entries[i].len() * 2; let j = i * 8; uint32::pack2(&mut header[j..j+8], self.pos, len as u32); for e in self.entries[i].iter() { let mut wh = (e.hash as usize >> 8) % len; while table[wh].pos != 0 { wh += 1; if wh == len { wh = 0; } } table[wh] = *e; } for hp in table.iter_mut().take(len) { hp.pack(&mut buf); try!(self.file.write(&buf)); try!(self.pos_plus(8)); *hp = HashPos{ hash: 0, pos: 0 }; } } try!(self.file.flush()); try!(self.file.seek(io::SeekFrom::Start(0))); try!(self.file.write(&header)); try!(self.file.flush()); Ok(()) } } /// A CDB file writer which handles atomic updating. /// /// Using this type, a CDB file is safely written by first creating a /// temporary file, building the CDB structure into that temporary file, /// and finally renaming that temporary file over the final file name. /// If the temporary file is not properly finished (ie due to an error), /// the temporary file is deleted when this writer is dropped. /// /// # Example /// /// ```no_run /// use cdb::CDBWriter; /// /// fn main() -> std::io::Result<()> { /// let mut cdb = CDBWriter::create("temporary.cdb")?; /// cdb.add(b"one", b"Hello")?; /// cdb.finish()?; /// Ok(()) /// } /// ``` pub struct CDBWriter { dstname: String, tmpname: String, cdb: Option, } impl CDBWriter { /// Safely create a new CDB file. /// /// The suffix for the temporary file defaults to `".tmp"`. pub fn create + string::ToString>(filename: P) -> Result { CDBWriter::with_suffix(filename, ".tmp") } /// Safely create a new CDB file, using a specific suffix for the temporary file. pub fn with_suffix + string::ToString>(filename: P, suffix: &str) -> Result { let mut tmpname = filename.to_string(); tmpname.push_str(suffix); CDBWriter::with_filenames(filename, &tmpname) } /// Safely create a new CDB file, using two specific file names. /// /// Note that the temporary file name must be on the same filesystem /// as the destination, or else the final rename will fail. pub fn with_filenames + string::ToString, Q: AsRef + string::ToString>(filename: P, tmpname: Q) -> Result { let file = try!(fs::File::create(&tmpname)); let cdb = try!(CDBMake::new(file)); Ok(CDBWriter { dstname: filename.to_string(), tmpname: tmpname.to_string(), cdb: Some(cdb), }) } /// Add a record to the CDB file. pub fn add(&mut self, key: &[u8], data: &[u8]) -> Result<()> { // The unwrap() is safe here, as the internal cdb is only ever // None during finish(), which does not call this. self.cdb.as_mut().unwrap().add(key, data) } /// Set permissions on the temporary file. /// /// This must be done before the file is finished, as the temporary /// file will no longer exist at that point. pub fn set_permissions(&self, perm: fs::Permissions) -> Result<()> { self.cdb.as_ref().unwrap().set_permissions(perm) } pub fn finish(mut self) -> Result<()> { try!(self.cdb.take().unwrap().finish()); try!(fs::rename(&self.tmpname, &self.dstname)); Ok(()) } } impl Drop for CDBWriter { #[allow(unused_must_use)] fn drop(&mut self) { if let Some(_) = self.cdb { fs::remove_file(&self.tmpname); } } } cdb-0.6.0/tests/make.rs010066400007640000764000000027231336444701200131350ustar0000000000000000extern crate cdb; use std::fs; macro_rules! noerr { ( $e:expr ) => { if let Err(x) = $e { panic!("{}", x); } } } #[test] fn test_make() { let filename = "tests/make.cdb"; let mut cdb = cdb::CDBWriter::create(filename).unwrap(); noerr!(cdb.add(b"one", b"Hello")); noerr!(cdb.add(b"two", b"Goodbye")); noerr!(cdb.add(b"one", b", World!")); noerr!(cdb.add(b"this key will be split across two reads", b"Got it.")); noerr!(cdb.finish()); let cdb = cdb::CDB::open(filename).unwrap(); assert_eq!(cdb.find(b"two").next().unwrap().unwrap(), b"Goodbye"); assert_eq!(cdb.find(b"this key will be split across two reads").next().unwrap().unwrap(), b"Got it."); let mut i = cdb.find(b"one"); assert_eq!(i.next().unwrap().unwrap(), b"Hello"); assert_eq!(i.next().unwrap().unwrap(), b", World!"); let mut i = cdb.iter(); let next = i.next().unwrap().unwrap(); assert_eq!(next.0, b"one"); assert_eq!(next.1, b"Hello"); let next = i.next().unwrap().unwrap(); assert_eq!(next.0, b"two"); assert_eq!(next.1, b"Goodbye"); let next = i.next().unwrap().unwrap(); assert_eq!(next.0, b"one"); assert_eq!(next.1, b", World!"); let next = i.next().unwrap().unwrap(); // Can't do this key easily due to missing trait for [u8; 39] //assert_eq!(next.0, b"this key will be split across two reads"); assert_eq!(next.1, b"Got it."); noerr!(fs::remove_file(filename)); } cdb-0.6.0/tests/read.rs010066400007640000764000000010001332612130200131030ustar0000000000000000extern crate cdb; #[test] fn test_one() { let cdb = cdb::CDB::open("tests/test1.cdb").unwrap(); let mut i = cdb.find(b"one"); assert_eq!(i.next().unwrap().unwrap(), b"Hello"); assert_eq!(i.next().unwrap().unwrap(), b", World!"); } #[test] fn test_two() { let cdb = cdb::CDB::open("tests/test1.cdb").unwrap(); assert_eq!(cdb.find(b"two").next().unwrap().unwrap(), b"Goodbye"); assert_eq!(cdb.find(b"this key will be split across two reads").next().unwrap().unwrap(), b"Got it."); } cdb-0.6.0/tests/test1.cdb010064400007640000764000000042531264347270600133710ustar0000000000000000kkkkkkkkkkkkkk{{{{{{{{{{{{{{{{{{{{{{{{{{{{oneHellotwoGoodbyeone, World!'this key will be split across two readsGot it. ۊ5)` [ "[ cdb-0.6.0/tests/test1.txt010066400007640000764000000001551264331014600134440ustar0000000000000000+3,5:one->Hello +3,7:two->Goodbye +3,8:one->, World! +39,7:this key will be split across two reads->Got it. cdb-0.6.0/tests/test2.cdb010064400007640000764000002351051336445474100133740ustar00000000000000005 սUվU 5u u%%5UUeeeuu5Ee u5 %E E%5EEEeeeu eU e U %U e55UeE eeeu%%5EEEu%  U  !E! E""######$$%$%$%$E$U$e$e$u$$% e%&&e''( (%)e))**U++ ++,,,,5,U,U,U,e,e,e,u,,,,,U---E.u.. //001 e1252222222233%3535353E3E3e33 3u45 e55U667E7 77%8e8959999999999:::%:5:5:5:5926542718281828459045one11853085436563656918090one27779628154845485377135one337061610873127313836180one496327013591409142295225one555592416309690970754270one614857819027972799213315one774123221746254627672360one833388624464536456131405one992654027182818284590450one1051919429901100113049495one1111184832619381941508540one1270450235337663769967585one1329715638055945598426630one1488981040774227426885675one1548246443492509255344720one167511846210791083803765one1766777248929072912262810one1826042651647354740721855one1985308054365636569180900one2044573457083918397639945one213838859802200226098990one2263104262520482054558035one2322369665238763883017080one2481635067957045711476125one2540900470675327539935170one26165873393609368394215one2759431276111891196853260one2818696678830173025312305one2977962081548454853771350one3037227484266736682230395one3196492886985018510689440one3255758289703300339148485one3315023692421582167607530one3474289095139863996066575one3533554497858145824525620one36928198100576427652984665one37520852103294709481443710one38113506106012991309902755one39706160108731273138361800one40298814111449554966820845one41891468114167836795279890one42484122116886118623738935one4376776119604400452197980one44669430122322682280657025one45262084125040964109116070one46854738127759245937575115one47447392130477527766034160one4840046133195809594493205one49632700135914091422952250one50225354138632373251411295one51818008141350655079870340one52410662144068936908329385one533316146787218736788430one54595970149505500565247475one55188624152223782393706520one56781278154942064222165565one57373932157660346050624610one58966586160378627879083655one59559240163096909707542700one60151894165815191536001745one61744548168533473364460790one62337202171251755192919835one63929856173970037021378880one64522510176688318849837925one65115164179406600678296970one66707818182124882506756015one67300472184843164335215060one68893126187561446163674105one69485780190279727992133150one7078434192998009820592195one71671088195716291649051240one72263742198434573477510285one73856396201152855305969330one74449050203871137134428375one7541704206589418962887420one76634358209307700791346465one77227012212025982619805510one78819666214744264448264555one79412320217462546276723600one804974220180828105182645one81597628222899109933641690one82190282225617391762100735one83782936228335673590559780one84375590231053955419018825one85968244233772237247477870one86560898236490519075936915one87153552239208800904395960one88746206241927082732855005one89338860244645364561314050one90931514247363646389773095one91524168250081928218232140one92116822252800210046691185one93709476255518491875150230one94302130258236773703609275one95894784260955055532068320one96487438263673337360527365one9780092266391619188986410one98672746269109901017445455one99265400271828182845904500one100858054274546464674363545one101450708277264746502822590one10243362279983028331281635one103636016282701310159740680one104228670285419591988199725one105821324288137873816658770one106413978290856155645117815one1076632293574437473576860one108599286296292719302035905one109191940299011001130494950one110784594301729282958953995one111377248304447564787413040one112969902307165846615872085one113562556309884128444331130one114155210312602410272790175one115747864315320692101249220one116340518318038973929708265one117933172320757255758167310one118525826323475537586626355one119118480326193819415085400one120711134328912101243544445one121303788331630383072003490one122896442334348664900462535one123489096337066946728921580one12481750339785228557380625one125674404342503510385839670one126267058345221792214298715one127859712347940074042757760one128452366350658355871216805one12945020353376637699675850one130637674356094919528134895one131230328358813201356593940one132822982361531483185052985one133415636364249765013512030one1348290366968046841971075one135600944369686328670430120one136193598372404610498889165one137786252375122892327348210one138378906377841174155807255one139971560380559455984266300one140564214383277737812725345one141156868385996019641184390one142749522388714301469643435one143342176391432583298102480one144934830394150865126561525one145527484396869146955020570one146120138399587428783479615one147712792402305710611938660one148305446405023992440397705one149898100407742274268856750one150490754410460556097315795one15183408413178837925774840one152676062415897119754233885one153268716418615401582692930one154861370421333683411151975one155454024424051965239611020one15646678426770247068070065one157639332429488528896529110one158231986432206810724988155one159824640434925092553447200one160417294437643374381906245one1619948440361656210365290one162602602443079938038824335one163195256445798219867283380one164787910448516501695742425one165380564451234783524201470one166973218453953065352660515one167565872456671347181119560one168158526459389629009578605one169751180462107910838037650one170343834464826192666496695one171936488467544474494955740one172529142470262756323414785one173121796472981038151873830one174714450475699319980332875one175307104478417601808791920one176899758481135883637250965one177492412483854165465710010one17885066486572447294169055one179677720489290729122628100one180270374492009010951087145one181863028494727292779546190one182455682497445574608005235one18348336500163856436464280one184640990502882138264923325one185233644505600420093382370one186826298508318701921841415one187418952511036983750300460one18811606513755265578759505one189604260516473547407218550one190196914519191829235677595one191789568521910111064136640one192382222524628392892595685one193974876527346674721054730one194567530530064956549513775one195160184532783238377972820one196752838535501520206431865one197345492538219802034890910one198938146540938083863349955one199530800543656365691809000one200123454546374647520268045one201716108549092929348727090one202308762551811211177186135one203901416554529493005645180one204494070557247774834104225one20586724559966056662563270one206679378562684338491022315one207272032565402620319481360one208864686568120902147940405one209457340570839183976399450one21049994573557465804858495one211642648576275747633317540one212235302578994029461776585one213827956581712311290235630one214420610584430593118694675one21513264587148874947153720one216605918589867156775612765one217198572592585438604071810one218791226595303720432530855one219383880598022002260989900one220976534600740284089448945one221569188603458565917907990one222161842606176847746367035one223754496608895129574826080one224347150611613411403285125one225939804614331693231744170one226532458617049975060203215one227125112619768256888662260one228717766622486538717121305one229310420625204820545580350one230903074627923102374039395one231495728630641384202498440one23288382633359666030957485one233681036636077947859416530one234273690638796229687875575one235866344641514511516334620one236458998644232793344793665one23751652646951075173252710one238644306649669357001711755one239236960652387638830170800one240829614655105920658629845one241422268657824202487088890one24214922660542484315547935one243607576663260766144006980one244200230665979047972466025one245792884668697329800925070one246385538671415611629384115one247978192674133893457843160one248570846676852175286302205one249163500679570457114761250one250756154682288738943220295one251348808685007020771679340one252941462687725302600138385one253534116690443584428597430one254126770693161866257056475one255719424695880148085515520one256312078698598429913974565one257904732701316711742433610one258497386704034993570892655one25990040706753275399351700one260682694709471557227810745one261275348712189839056269790one262868002714908120884728835one263460656717626402713187880one26453310720344684541646925one265645964723062966370105970one266238618725781248198565015one267831272728499530027024060one268423926731217811855483105one26916580733936093683942150one270609234736654375512401195one271201888739372657340860240one272794542742090939169319285one273387196744809220997778330one274979850747527502826237375one275572504750245784654696420one276165158752964066483155465one277757812755682348311614510one278350466758400630140073555one279943120761118911968532600one280535774763837193796991645one281128428766555475625450690one282721082769273757453909735one283313736771992039282368780one284906390774710321110827825one285499044777428602939286870one28691698780146884767745915one287684352782865166596204960one288277006785583448424664005one289869660788301730253123050one290462314791020012081582095one29154968793738293910041140one292647622796456575738500185one293240276799174857566959230one294832930801893139395418275one295425584804611421223877320one29618238807329703052336365one297610892810047984880795410one298203546812766266709254455one299796200815484548537713500one300388854818202830366172545one301981508820921112194631590one302574162823639394023090635one303166816826357675851549680one304759470829075957680008725one305352124831794239508467770one306944778834512521336926815one307537432837230803165385860one308130086839949084993844905one309722740842667366822303950one310315394845385648650762995one311908048848103930479222040one312500702850822212307681085one31393356853540494136140130one314686010856258775964599175one315278664858977057793058220one316871318861695339621517265one317463972864413621449976310one31856626867131903278435355one319649280869850185106894400one320241934872568466935353445one321834588875286748763812490one322427242878005030592271535one32319896880723312420730580one324612550883441594249189625one325205204886159876077648670one326797858888878157906107715one327390512891596439734566760one328983166894314721563025805one329575820897033003391484850one330168474899751285219943895one331761128902469567048402940one332353782905187848876861985one333946436907906130705321030one334539090910624412533780075one335131744913342694362239120one336724398916060976190698165one337317052918779258019157210one338909706921497539847616255one339502360924215821676075300one34095014926934103504534345one341687668929652385332993390one342280322932370667161452435one343872976935088948989911480one344465630937807230818370525one34558284940525512646829570one346650938943243794475288615one347243592945962076303747660one348836246948680358132206705one349428900951398639960665750one35021554954116921789124795one351614208956835203617583840one352206862959553485446042885one353799516962271767274501930one354392170964990049102960975one355984824967708330931420020one356577478970426612759879065one357170132973144894588338110one358762786975863176416797155one359355440978581458245256200one360948094981299740073715245one361540748984018021902174290one362133402986736303730633335one363726056989454585559092380one364318710992172867387551425one365911364994891149216010470one366504018997609431044469515one367966721000327712872928560one3686893261003045994701387605one3692819801005764276529846650one3708746341008482558358305695one3714672881011200840186764740one372599421013919122015223785one3736525961016637403843682830one3742452501019355685672141875one3758379041022073967500600920one3764305581024792249329059965one377232121027510531157519010one3786158661030228812985978055one3792085201032947094814437100one3808011741035665376642896145one3813938281038383658471355190one3829864821041101940299814235one3835791361043820222128273280one3841717901046538503956732325one3857644441049256785785191370one3863570981051975067613650415one3879497521054693349442109460one3885424061057411631270568505one3891350601060129913099027550one3907277141062848194927486595one3913203681065566476755945640one3929130221068284758584404685one3935056761071003040412863730one394983301073721322241322775one3956909841076439604069781820one3962836381079157885898240865one3978762921081876167726699910one3984689461084594449555158955one399616001087312731383618000one4006542541090031013212077045one4012469081092749295040536090one4028395621095467576868995135one4034322161098185858697454180one404248701100904140525913225one4056175241103622422354372270one4062101781106340704182831315one4078028321109058986011290360one4083954861111777267839749405one4099881401114495549668208450one4105807941117213831496667495one4111734481119932113325126540one4127661021122650395153585585one4133587561125368676982044630one4149514101128086958810503675one4155440641130805240638962720one4161367181133523522467421765one4177293721136241804295880810one4183220261138960086124339855one4199146801141678367952798900one4205073341144396649781257945one421999881147114931609716990one4226926421149833213438176035one4232852961152551495266635080one4248779501155269777095094125one4254706041157988058923553170one426632581160706340752012215one4276559121163424622580471260one4282485661166142904408930305one4298412201168861186237389350one4304338741171579468065848395one431265281174297749894307440one4326191821177016031722766485one4332118361179734313551225530one4348044901182452595379684575one4353971441185170877208143620one4369897981187889159036602665one4375824521190607440865061710one4381751061193325722693520755one4397677601196044004521979800one4403604141198762286350438845one4419530681201480568178897890one4425457221204198850007356935one4431383761206917131835815980one4447310301209635413664275025one4453236841212353695492734070one4469163381215071977321193115one4475089921217790259149652160one4481016461220508540978111205one4496943001223226822806570250one4502869541225945104635029295one4518796081228663386463488340one4524722621231381668291947385one453649161234099950120406430one4546575701236818231948865475one4552502241239536513777324520one4568428781242254795605783565one4574355321244973077434242610one458281861247691359262701655one4596208401250409641091160700one4602134941253127922919619745one4618061481255846204748078790one4623988021258564486576537835one4639914561261282768404996880one4645841101264001050233455925one4651767641266719332061914970one4667694181269437613890374015one4673620721272155895718833060one4689547261274874177547292105one4695473801277592459375751150one4701400341280310741204210195one4717326881283029023032669240one4723253421285747304861128285one4739179961288465586689587330one4745106501291183868518046375one4751033041293902150346505420one4766959581296620432174964465one4772886121299338714003423510one4788812661302056995831882555one4794739201304775277660341600one480665741307493559488800645one4816592281310211841317259690one4822518821312930123145718735one4838445361315648404974177780one4844371901318366686802636825one485298441321084968631095870one4866224981323803250459554915one4872151521326521532288013960one4888078061329239814116473005one4894004601331958095944932050one4909931141334676377773391095one4915857681337394659601850140one4921784221340112941430309185one4937710761342831223258768230one4943637301345549505087227275one4959563841348267786915686320one4965490381350986068744145365one4971416921353704350572604410one4987343461356422632401063455one4993270001359140914229522500one5009196541361859196057981545one5015123081364577477886440590one5021049621367295759714899635one5036976161370014041543358680one5042902701372732323371817725one5058829241375450605200276770one5064755781378168887028735815one507682321380887168857194860one5086608861383605450685653905one5092535401386323732514112950one5108461941389042014342571995one5114388481391760296171031040one512315021394478577999490085one5136241561397196859827949130one5142168101399915141656408175one5158094641402633423484867220one5164021181405351705313326265one5179947721408069987141785310one5185874261410788268970244355one5191800801413506550798703400one5207727341416224832627162445one5213653881418943114455621490one5229580421421661396284080535one5235506961424379678112539580one5241433501427097959940998625one5257360041429816241769457670one5263286581432534523597916715one5279213121435252805426375760one5285139661437971087254834805one5291066201440689369083293850one5306992741443407650911752895one5312919281446125932740211940one5328845821448844214568670985one5334772361451562496397130030one534698901454280778225589075one5356625441456999060054048120one5362551981459717341882507165one5378478521462435623710966210one5384405061465153905539425255one539331601467872187367884300one5406258141470590469196343345one5412184681473308751024802390one5428111221476027032853261435one5434037761478745314681720480one5449964301481463596510179525one5455890841484181878338638570one5461817381486900160167097615one5477743921489618441995556660one5483670461492336723824015705one5499597001495055005652474750one5505523541497773287480933795one5511450081500491569309392840one5527376621503209851137851885one5533303161505928132966310930one5549229701508646414794769975one5555156241511364696623229020one5561082781514082978451688065one5577009321516801260280147110one5582935861519519542108606155one5598862401522237823937065200one5604788941524956105765524245one561715481527674387593983290one5626642021530392669422442335one5632568561533110951250901380one5648495101535829233079360425one5654421641538547514907819470one566348181541265796736278515one5676274721543984078564737560one5682201261546702360393196605one5698127801549420642221655650one5704054341552138924050114695one5719980881554857205878573740one5725907421557575487707032785one5731833961560293769535491830one5747760501563012051363950875one5753687041565730333192409920one5769613581568448615020868965one5775540121571166896849328010one5781466661573885178677787055one5797393201576603460506246100one5803319741579321742334705145one5819246281582040024163164190one5825172821584758305991623235one5831099361587476587820082280one5847025901590194869648541325one5852952441592913151477000370one5868878981595631433305459415one5874805521598349715133918460one588732061601067996962377505one5896658601603786278790836550one5902585141606504560619295595one5918511681609222842447754640one5924438221611941124276213685one593364761614659406104672730one5946291301617377687933131775one5952217841620095969761590820one5968144381622814251590049865one5974070921625532533418508910one5989997461628250815246967955one5995924001630969097075427000one6001850541633687378903886045one6017777081636405660732345090one6023703621639123942560804135one6039630161641842224389263180one6045556701644560506217722225one6051483241647278788046181270one6067409781649997069874640315one6073336321652715351703099360one6089262861655433633531558405one6095189401658151915360017450one6101115941660870197188476495one6117042481663588479016935540one6122969021666306760845394585one6138895561669025042673853630one6144822101671743324502312675one615748641674461606330771720one6166675181677179888159230765one6172601721679898169987689810one6188528261682616451816148855one6194454801685334733644607900one620381341688053015473066945one6216307881690771297301525990one6222234421693489579129985035one6238160961696207860958444080one6244087501698926142786903125one62514041701644424615362170one6265940581704362706443821215one6271867121707080988272280260one6287793661709799270100739305one6293720201712517551929198350one6309646741715235833757657395one6315573281717954115586116440one6321499821720672397414575485one6337426361723390679243034530one6343352901726108961071493575one6359279441728827242899952620one6365205981731545524728411665one6371132521734263806556870710one6387059061736982088385329755one6392985601739700370213788800one6408912141742418652042247845one6414838681745136933870706890one642765221747855215699165935one6436691761750573497527624980one6442618301753291779356084025one6458544841756010061184543070one6464471381758728343013002115one647397921761446624841461160one6486324461764164906669920205one6492251001766883188498379250one6508177541769601470326838295one6514104081772319752155297340one65230621775038033983756385one6535957161777756315812215430one6541883701780474597640674475one6557810241783192879469133520one6563736781785911161297592565one6579663321788629443126051610one6585589861791347724954510655one6591516401794066006782969700one6607442941796784288611428745one6613369481799502570439887790one6629296021802220852268346835one6635222561804939134096805880one6641149101807657415925264925one6657075641810375697753723970one6663002181813093979582183015one6678928721815812261410642060one6684855261818530543239101105one669781801821248825067560150one6706708341823967106896019195one6712634881826685388724478240one6728561421829403670552937285one6734487961832121952381396330one674414501834840234209855375one6756341041837558516038314420one6762267581840276797866773465one6778194121842995079695232510one6784120661845713361523691555one67947201848431643352150600one6805973741851149925180609645one6811900281853868207009068690one6827826821856586488837527735one6833753361859304770665986780one6849679901862023052494445825one6855606441864741334322904870one6861532981867459616151363915one6877459521870177897979822960one6883386061872896179808282005one6899312601875614461636741050one6905239141878332743465200095one6911165681881051025293659140one6927092221883769307122118185one6933018761886487588950577230one6948945301889205870779036275one6954871841891924152607495320one696798381894642434435954365one6976724921897360716264413410one6982651461900078998092872455one6998578001902797279921331500one7004504541905515561749790545one701431081908233843578249590one7026357621910952125406708635one7032284161913670407235167680one7048210701916388689063626725one7054137241919106970892085770one70663781921825252720544815one7075990321924543534549003860one7081916861927261816377462905one7097843401929980098205921950one7103769941932698380034380995one7119696481935416661862840040one7125623021938134943691299085one7131549561940853225519758130one7147476101943571507348217175one7153402641946289789176676220one7169329181949008071005135265one7175255721951726352833594310one7181182261954444634662053355one7197108801957162916490512400one7203035341959881198318971445one7218961881962599480147430490one7224888421965317761975889535one723814961968036043804348580one7246741501970754325632807625one7252668041973472607461266670one7268594581976190889289725715one7274521121978909171118184760one728447661981627452946643805one7296374201984345734775102850one7302300741987064016603561895one7318227281989782298432020940one7324153821992500580260479985one73380361995218862088939030one7346006901997937143917398075one7351933442000655425745857120one7367859982003373707574316165one7373786522006091989402775210one7389713062008810271231234255one7395639602011528553059693300one7401566142014246834888152345one7417492682016965116716611390one7423419222019683398545070435one7439345762022401680373529480one7445272302025119962201988525one7451198842027838244030447570one7467125382030556525858906615one7473051922033274807687365660one7488978462035993089515824705one7494905002038711371344283750one750831542041429653172742795one7516758082044147935001201840one7522684622046866216829660885one7538611162049584498658119930one7544537702052302780486578975one755464242055021062315038020one7566390782057739344143497065one7572317322060457625971956110one7588243862063175907800415155one7594170402065894189628874200one76096942068612471457333245one7616023482071330753285792290one7621950022074049035114251335one7637876562076767316942710380one7643803102079485598771169425one7659729642082203880599628470one7665656182084922162428087515one7671582722087640444256546560one7687509262090358726085005605one7693435802093077007913464650one7709362342095795289741923695one7715288882098513571570382740one7721215422101231853398841785one7737141962103950135227300830one7743068502106668417055759875one7758995042109386698884218920one7764921582112104980712677965one777848122114823262541137010one7786774662117541544369596055one7792701202120259826198055100one7808627742122978108026514145one7814554282125696389854973190one782480822128414671683432235one7836407362131132953511891280one7842333902133851235340350325one7858260442136569517168809370one7864186982139287798997268415one787113522142006080825727460one7886040062144724362654186505one7891966602147442644482645550one7907893142150160926311104595one7913819682152879208139563640one7929746222155597489968022685one7935672762158315771796481730one7941599302161034053624940775one7957525842163752335453399820one7963452382166470617281858865one7979378922169188899110317910one7985305462171907180938776955one7991232002174625462767236000one8007158542177343744595695045one8013085082180062026424154090one8029011622182780308252613135one8034938162185498590081072180one804864702188216871909531225one8056791242190935153737990270one8062717782193653435566449315one8078644322196371717394908360one8084570862199089999223367405one809497402201808281051826450one8106423942204526562880285495one8112350482207244844708744540one8128277022209963126537203585one8134203562212681408365662630one814130102215399690194121675one8156056642218117972022580720one8161983182220836253851039765one8177909722223554535679498810one8183836262226272817507957855one8199762802228991099336416900one8205689342231709381164875945one8211615882234427662993334990one8227542422237145944821794035one8233468962239864226650253080one8249395502242582508478712125one8255322042245300790307171170one8261248582248019072135630215one8277175122250737353964089260one8283101662253455635792548305one8299028202256173917621007350one8304954742258892199449466395one831881282261610481277925440one8326807822264328763106384485one8332734362267047044934843530one8348660902269765326763302575one8354587442272483608591761620one836513982275201890420220665one8376440522277920172248679710one8382367062280638454077138755one8398293602283356735905597800one8404220142286075017734056845one841146682288793299562515890one8426073222291511581390974935one8431999762294229863219433980one8447926302296948145047893025one8453852842299666426876352070one8469779382302384708704811115one8475705922305102990533270160one8481632462307821272361729205one8497559002310539554190188250one8503485542313257836018647295one8519412082315976117847106340one8525338622318694399675565385one8531265162321412681504024430one8547191702324130963332483475one8553118242326849245160942520one8569044782329567526989401565one8574971322332285808817860610one858897862335004090646319655one8596824402337722372474778700one8602750942340440654303237745one8618677482343158936131696790one8624604022345877217960155835one863530562348595499788614880one8646457102351313781617073925one8652383642354032063445532970one8668310182356750345273992015one8674236722359468627102451060one868163262362186908930910105one8696089802364905190759369150one8702016342367623472587828195one8717942882370341754416287240one8723869422373060036244746285one8739795962375778318073205330one8745722502378496599901664375one8751649042381214881730123420one8767575582383933163558582465one8773502122386651445387041510one8789428662389369727215500555one8795355202392088009043959600one8801281742394806290872418645one8817208282397524572700877690one8823134822400242854529336735one8839061362402961136357795780one8844987902405679418186254825one885914442408397700014713870one8866840982411115981843172915one8872767522413834263671631960one8888694062416552545500091005one8894620602419270827328550050one890547142421989109157009095one8916473682424707390985468140one8922400222427425672813927185one8938326762430143954642386230one8944253302432862236470845275one895179842435580518299304320one8966106382438298800127763365one8972032922441017081956222410one8987959462443735363784681455one8993886002446453645613140500one9009812542449171927441599545one9015739082451890209270058590one9021665622454608491098517635one9037592162457326772926976680one9043518702460045054755435725one9059445242462763336583894770one9065371782465481618412353815one9071298322468199900240812860one9087224862470918182069271905one9093151402473636463897730950one9109077942476354745726189995one9115004482479073027554649040one912931022481791309383108085one9136857562484509591211567130one9142784102487227873040026175one9158710642489946154868485220one9164637182492664436696944265one917563722495382718525403310one9186490262498101000353862355one9192416802500819282182321400one9208343342503537564010780445one9214269882506255845839239490one922196422508974127667698535one9236122962511692409496157580one9242049502514410691324616625one9257976042517128973153075670one9263902582519847254981534715one9279829122522565536809993760one9285755662525283818638452805one9291682202528002100466911850one9307608742530720382295370895one9313535282533438664123829940one9329461822536156945952288985one9335388362538875227780748030one9341314902541593509609207075one9357241442544311791437666120one9363167982547030073266125165one9379094522549748355094584210one9385021062552466636923043255one939947602555184918751502300one9406874142557903200579961345one9412800682560621482408420390one9428727222563339764236879435one9434653762566058046065338480one944580302568776327893797525one9456506842571494609722256570one9462433382574212891550715615one9478359922576931173379174660one9484286462579649455207633705one949213002582367737036092750one9506139542585086018864551795one9512066082587804300693010840one9527992622590522582521469885one9533919162593240864349928930one9549845702595959146178387975one9555772242598677428006847020one9561698782601395709835306065one9577625322604113991663765110one9583551862606832273492224155one9599478402609550555320683200one9605404942612268837149142245one9611331482614987118977601290one9627258022617705400806060335one9633184562620423682634519380one9649111102623141964462978425one9655037642625860246291437470one966964182628578528119896515one9676890722631296809948355560one9682817262634015091776814605one9698743802636733373605273650one9704670342639451655433732695one971596882642169937262191740one9726523422644888219090650785one9732449962647606500919109830one9748376502650324782747568875one9754303042653043064576027920one976229582655761346404486965one9776156122658479628232946010one9782082662661197910061405055one9798009202663916191889864100one9803935742666634473718323145one9819862282669352755546782190one9825788822672071037375241235one9831715362674789319203700280one9847641902677507601032159325one9853568442680225882860618370one9869494982682944164689077415one9875421522685662446517536460one9881348062688380728345995505one9897274602691099010174454550one9903201142693817292002913595one9919127682696535573831372640one9925054222699253855659831685one993980762701972137488290730one9946907302704690419316749775one9952833842707408701145208820one9968760382710126982973667865one9974686922712845264802126910one998613462715563546630585955one9996540002718281828459045000one1000twoGoodbye}P支P9!Q::EOXRU_6q*t ֢:gZq6|I8{^ թbv֮Yfv=ܳ=Z巜9M:Nƺ9|kO&-GSaڮ|zo ;\ uڐ\jagplsՎ"݊*Jfrո+Y^YݰE֝g=PYoi3BܣC5= А)hxrD,jy, R1ݤ)Fh\=^@QcK!a/}DSәaBT/> `㷏 5 q   s c ջT y .L5 _ #ֆ ڇ Ew h*] t! kݏ _YD  :Z 8 oZ1 o #=& jï q? vp  M 3! ׬G ;-H ݹh ؔ D ♌ I 6L"r[#KŶ婡ܽB&֔cxͽKz5"ݳ%rC&]S|j n>:-/V:71"6{qzz;@Ed5NAJO0j HUZ bb%[ U  m' ,D fݮF!0!Tp>!/u0!&ڤ<!C^! !>!!èڈ"0ʦ"d8"W"U|j}"_":֖"_"F#(]#i#cZ##ѹ7# #-n,#W%f#WGC$J$kR|$#,$N*$ e$-$d$%<$S|yx%/?\%e%`I%G`%:-/&(&ˆ&]&[hѪ&/條&~'&-#:&FOf&ʑ>r&=6ݠ&&P&$3'-D'Rc'c('qbں 'ʩy'{(s' 氥'܉'*C',R'v`'((֬(n(es(zፄ)FmP)͎)$)g$)LX|E$)`")6)` #))>*}؂~*g*J*p16**#ݤ*++m++9+.=,,r`w,/0,Jp+,ɨ,(Y,q`-+-D-Vr^-n^-卫-3-jR3-rn-у-ㄚ..q.+g.+.:JJ.mr/DH/#m=/"/802LQK2[33ż47O5|5Ow<5?q6|6^7c8R=;;'>}`#?~6(@t@@Mz@L U @ئx@P\AP׬AcڟA*KA%VAuCA5nA GkA.vMB5BBBBQBBaVB1\BvkB;~Bo㌞CQafGCzâCF CՋ_DeWD* 4DVDo{KmE澠EE!E5alEM.F 2#FuIFv FV oF]Fڨ"F}AVFϏieGEyGM&G\GPdnG`ڽwGWsSGTfG-[GSmH,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%me`YICf^R|L sk&ᅤZRchH`$Nw)QQ'3f"|baSӷcdb-0.6.0/tests/test2.sh010066400007640000764000000003101336445370200132400ustar0000000000000000for i in $( seq 1000 ) do key=$(( $i * 3141592654 % 1000000 )) val=$(( $i * 2718281828459045 )) echo "+${#key},${#val}:${key}->${val}" echo "+3,${#i}:one->${i}" done echo "+3,7:two->Goodbye" echo cdb-0.6.0/Makefile010066400007640000764000000001771332620561600121510ustar0000000000000000all: cargo build cargo test $(MAKE) doc doc: cargo doc --no-deps upload: rsync -a --delete target/doc/ ../github/cdb-rs