Enchantrix/vault/lib/parse/file.ts
google-labs-jules[bot] 63721e9811 feat: Add ChaCha20-Poly1305 encryption
This commit introduces ChaCha20-Poly1305 encryption functionality. It includes the following changes:

- A new `chachapoly` package has been added.
- The `chachapoly` package contains `Encrypt` and `Decrypt` functions.
- The functionality is fully tested.
- An `.ideas` directory has been created.
2025-10-30 19:01:08 +00:00

33 lines
760 B
TypeScript

#!deno run --allow-read --allow-net
import * as path from "https://deno.land/std@0.122.0/path/mod.ts";
import { readableStreamFromReader } from "https://deno.land/std@0.122.0/streams/mod.ts";
import {EnchantrixLog} from '../log.ts';
export class EnchantrixParseFile {
protected _input: string;
protected _data: any;
constructor(file: string) {
this._input = file;
}
load() {
try {
this._data = Deno.openSync(this._input, { read: true });
const stat = this._data.statSync();
} catch {
throw new EnchantrixLog('Failed to load file')
}
// Build a readable stream so the file doesn't have to be fully loaded into
// memory while we send it
const readableStream = readableStreamFromReader(this._data);
return readableStream
}
}