-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Database Format for the open() Method
Ophir LOJKINE edited this page Jun 12, 2014
·
3 revisions
To open an existing database you must supply the new SQL.Database()
method with an array of integers where each integer represents a byte of the database file.
If you have a binary string representing your database, you can convert it to an array of bytes:
function bin2Array(bin) {
'use strict';
var i, size = bin.length, ary = [];
for (i = 0; i < size; i++) {
ary.push(bin.charCodeAt(i) & 0xFF);
}
return ary;
}