xypriss-security
Version:
XyPriss Security is an advanced JavaScript security library designed for enterprise applications. It provides military-grade encryption, secure data structures, quantum-resistant cryptography, and comprehensive security utilities for modern web applicatio
86 lines (83 loc) • 3.35 kB
JavaScript
import { SecureString } from '../../secure-string/core/secure-string-core.js';
import 'crypto';
import '../../../types/secure-memory.js';
import '../../secure-string/advanced/entropy-analyzer.js';
import '../../secure-string/advanced/quantum-safe.js';
import '../../secure-string/advanced/performance-monitor.js';
import { SecureObject } from '../../secure-object/core/secure-object-core.js';
import '../../../core/hash/hash-core.js';
import '../../../core/hash/hash-types.js';
import '../../../core/hash/hash-security.js';
import '../../../core/hash/hash-advanced.js';
import '../../../algorithms/hash-algorithms.js';
import '../../../core/random/random-types.js';
import '../../../core/random/random-sources.js';
import 'nehonix-uri-processor';
import '../../../utils/memory/index.js';
import '../../../types.js';
import '../../../core/random/random-security.js';
import 'nehoid';
/***************************************************************************
* XyPrissSecurity - Secure Array Types
*
* This file contains type definitions for the SecureArray modular architecture
*
* @author Nehonix
*
* @license MIT
*
* Copyright (c) 2025 Nehonix. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************** */
/**
* Type definitions for SecureArray modular architecture
*/
/**
* Default options for SecureArray
*/
const DEFAULT_SECURE_ARRAY_OPTIONS = {
readOnly: false,
autoDestroy: false,
encryptionKey: "",
maxMemory: 100 * 1024 * 1024, // 100MB
gcThreshold: 0.8,
enableMemoryTracking: true,
autoCleanup: true,
maxLength: Number.MAX_SAFE_INTEGER,
maxSize: Number.MAX_SAFE_INTEGER,
enableIndexValidation: true,
enableTypeValidation: true,
};
/**
* Type guard for SecureArray values
*/
function isSecureArrayValue(value) {
return (typeof value === "string" ||
typeof value === "number" ||
typeof value === "boolean" ||
value instanceof Uint8Array ||
value instanceof SecureString ||
value instanceof SecureObject ||
value === null ||
value === undefined ||
(typeof value === "object" && value !== null));
}
export { DEFAULT_SECURE_ARRAY_OPTIONS, isSecureArrayValue };
//# sourceMappingURL=index.js.map