Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Database Format for the open() Method

Ophir LOJKINE edited this page Jun 12, 2014 · 3 revisions

Introduction

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.

Conversion from binary string to byte array

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;
    }
Morty Proxy This is a proxified and sanitized view of the page, visit original site.