import { BinaryWriter } from "@dao-xyz/borsh";
import { sha256Sync, toBase58 } from "@peerbit/crypto";
import { SQLiteIndex, SQLiteIndices } from "./engine.js";
import { create as sqlite3 } from "./sqlite3.js";
export const encodeName = (name) => {
    const writer = new BinaryWriter();
    writer.string(name);
    return toBase58(sha256Sync(writer.finalize()));
};
const create = async (directory, options) => {
    const db = await sqlite3(directory, options);
    return new SQLiteIndices({ db, directory });
};
const createDatabase = (directory, options) => sqlite3(directory, options);
export { create, createDatabase, SQLiteIndices, SQLiteIndex, SQLiteIndex as SQLLiteIndex, };
//# sourceMappingURL=index.js.map