<commit_before>import { deriveFromPassword, pbkdf2 } from "./derivation";
import {
    decryptCBC,
    decryptGCM,
    encryptCBC,
    encryptGCM,
    generateIV,
    generateSalt
} from "./encryption";
import { packEncryptedText, unpackEncryptedText } from "./packing";
import { ALGO_DEFAULT, DERIVED_KEY_ITERATIONS } from "../base/shared";
import { ConfigurationOptions } from "../base/constructs";

const SALT_LENGTH = 12;

/**
 * Get the default options
 * @returns Default configuration options
 */
export function getDefaultOptions(): ConfigurationOptions {
    return {
        decryption_cbc: decryptCBC,
        decryption_gcm: decryptGCM,
        derivationRounds: DERIVED_KEY_ITERATIONS,
        deriveKey: deriveFromPassword,
        encryption_cbc: encryptCBC,
        encryption_gcm: encryptGCM,
        generateIV,
        generateSalt,
        method: ALGO_DEFAULT,
        pack_text: packEncryptedText,
        pbkdf2,
        saltLength: SALT_LENGTH,
        unpack_text: unpackEncryptedText
    };
}<commit_msg>Add data packing to defaults for web<commit_after>import { deriveFromPassword, pbkdf2 } from "./derivation";
import {
    decryptCBC,
    decryptGCM,
    encryptCBC,
    encryptGCM,
    generateIV,
    generateSalt
} from "./encryption";
import {
    packEncryptedData,
    packEncryptedText,
    unpackEncryptedData,
    unpackEncryptedText
} from "./packing";
import { ALGO_DEFAULT, DERIVED_KEY_ITERATIONS } from "../base/shared";
import { ConfigurationOptions } from "../base/constructs";

const SALT_LENGTH = 12;

/**
 * Get the default options
 * @returns Default configuration options
 */
export function getDefaultOptions(): ConfigurationOptions {
    return {
        decryption_cbc: decryptCBC,
        decryption_gcm: decryptGCM,
        derivationRounds: DERIVED_KEY_ITERATIONS,
        deriveKey: deriveFromPassword,
        encryption_cbc: encryptCBC,
        encryption_gcm: encryptGCM,
        generateIV,
        generateSalt,
        method: ALGO_DEFAULT,
        pack_data: packEncryptedData,
        pack_text: packEncryptedText,
        pbkdf2,
        saltLength: SALT_LENGTH,
        unpack_data: unpackEncryptedData,
        unpack_text: unpackEncryptedText
    };
}
{'fraction_non_alphanumeric': 0.08382154123479045, 'fraction_numerical': 0.003605227579990987, 'mean_word_length': 3.1965973534971646, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5180011', 'n_tokens_mistral': 687, 'n_tokens_neox': 657, 'n_words': 146}