Re[2]: Suggestion for EDS

new topic     » topic index » view thread      » older message » newer message

R> Aku writes:
>> 1. if user stores a sequence, make EDS can check if it is
>>   a string (all bytes 0-255). If yes, store as string (just use 1
>>   byte per atom). If not, store as usual. If this is make EDS slower
>>   make function enable_string() and disable_string() for example.
>>   So I can store contents of a 1 MB file without having a 4 MB .edb
>>   file.

R> EDS only uses one byte per character for strings
R> (except for extremely rare cases where 2 bytes might be used). 
R> There's also a couple of bytes of overhead.

Sorry I dont know that.
but if:

include database.e

procedure x(object notused)
end procedure

x(db_create("tes",DB_LOCK_NO))
x(db_open("tes",DB_LOCK_NO))
x(db_create_table("file"))
x(db_select_table("file"))

object isi
isi = {}
for i=1 to 1000000 do
    isi &= 254 -- large atom
end for

x(db_insert("file",isi))
db_close()


the database file size is 3MB
(3 bytes per atom)

R> See compress()/decompress() in database.e

>> 2. can make autonumber especially for record keys. 
>> and add indexing in same file (.edb) for record data.

R> I'll think about it.

>> 3. add encryption with password

R> The data is already slightly encrypted,
R> i.e. you can't load a .edb file into an editor
R> and visually read the strings or the numbers.

only adding 9 if 1 byte atom

still can be viewed very easily using db_dump()

R> I'm not sure I want to implement one of the
R> strong encryption algorithms. There are still some
R> U.S. export restrictions on encryption algorithms.
R> I wouldn't want Euphoria to be banned from
R> distribution by the large U.S. shareware sites.

Don't need to implement strong encryption. just very simple, by using
sequence code. for example:

data = {1,1,2,3,3,3,3,3,3,4}
code = {2,3,6,5}
encd = {3,4,8,8,5,6,9,8,5,7}
(adding data and code)

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu