Website Structure

This commit is contained in:
supalerk-ar66 2026-01-13 10:46:40 +07:00
parent 62812f2090
commit 71f0676a62
22365 changed files with 4265753 additions and 791 deletions

View file

@ -0,0 +1,58 @@
// npx -y node@22.14 -e 'const{constants}=require("crypto");console.log(Object.entries(constants).map(([k,v]) => `export const ${k} = ${JSON.stringify(v)}`).join("\n"))'
export declare const SSL_OP_ALL = 2147485776;
export declare const SSL_OP_ALLOW_NO_DHE_KEX = 1024;
export declare const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION = 262144;
export declare const SSL_OP_CIPHER_SERVER_PREFERENCE = 4194304;
export declare const SSL_OP_CISCO_ANYCONNECT = 32768;
export declare const SSL_OP_COOKIE_EXCHANGE = 8192;
export declare const SSL_OP_CRYPTOPRO_TLSEXT_BUG = 2147483648;
export declare const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS = 2048;
export declare const SSL_OP_LEGACY_SERVER_CONNECT = 4;
export declare const SSL_OP_NO_COMPRESSION = 131072;
export declare const SSL_OP_NO_ENCRYPT_THEN_MAC = 524288;
export declare const SSL_OP_NO_QUERY_MTU = 4096;
export declare const SSL_OP_NO_RENEGOTIATION = 1073741824;
export declare const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION = 65536;
export declare const SSL_OP_NO_SSLv2 = 0;
export declare const SSL_OP_NO_SSLv3 = 33554432;
export declare const SSL_OP_NO_TICKET = 16384;
export declare const SSL_OP_NO_TLSv1 = 67108864;
export declare const SSL_OP_NO_TLSv1_1 = 268435456;
export declare const SSL_OP_NO_TLSv1_2 = 134217728;
export declare const SSL_OP_NO_TLSv1_3 = 536870912;
export declare const SSL_OP_PRIORITIZE_CHACHA = 2097152;
export declare const SSL_OP_TLS_ROLLBACK_BUG = 8388608;
export declare const ENGINE_METHOD_RSA = 1;
export declare const ENGINE_METHOD_DSA = 2;
export declare const ENGINE_METHOD_DH = 4;
export declare const ENGINE_METHOD_RAND = 8;
export declare const ENGINE_METHOD_EC = 2048;
export declare const ENGINE_METHOD_CIPHERS = 64;
export declare const ENGINE_METHOD_DIGESTS = 128;
export declare const ENGINE_METHOD_PKEY_METHS = 512;
export declare const ENGINE_METHOD_PKEY_ASN1_METHS = 1024;
export declare const ENGINE_METHOD_ALL = 65535;
export declare const ENGINE_METHOD_NONE = 0;
export declare const DH_CHECK_P_NOT_SAFE_PRIME = 2;
export declare const DH_CHECK_P_NOT_PRIME = 1;
export declare const DH_UNABLE_TO_CHECK_GENERATOR = 4;
export declare const DH_NOT_SUITABLE_GENERATOR = 8;
export declare const RSA_PKCS1_PADDING = 1;
export declare const RSA_NO_PADDING = 3;
export declare const RSA_PKCS1_OAEP_PADDING = 4;
export declare const RSA_X931_PADDING = 5;
export declare const RSA_PKCS1_PSS_PADDING = 6;
export declare const RSA_PSS_SALTLEN_DIGEST = -1;
export declare const RSA_PSS_SALTLEN_MAX_SIGN = -2;
export declare const RSA_PSS_SALTLEN_AUTO = -2;
export declare const POINT_CONVERSION_COMPRESSED = 2;
export declare const POINT_CONVERSION_UNCOMPRESSED = 4;
export declare const POINT_CONVERSION_HYBRID = 6;
// Versions explicitly set to 0 to avoid version misdetections
export declare const defaultCoreCipherList = "";
export declare const defaultCipherList = "";
export declare const OPENSSL_VERSION_NUMBER = 0;
export declare const TLS1_VERSION = 0;
export declare const TLS1_1_VERSION = 0;
export declare const TLS1_2_VERSION = 0;
export declare const TLS1_3_VERSION = 0;

View file

@ -0,0 +1,58 @@
// npx -y node@22.14 -e 'const{constants}=require("crypto");console.log(Object.entries(constants).map(([k,v]) => `export const ${k} = ${JSON.stringify(v)}`).join("\n"))'
export const SSL_OP_ALL = 2147485776;
export const SSL_OP_ALLOW_NO_DHE_KEX = 1024;
export const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION = 262144;
export const SSL_OP_CIPHER_SERVER_PREFERENCE = 4194304;
export const SSL_OP_CISCO_ANYCONNECT = 32768;
export const SSL_OP_COOKIE_EXCHANGE = 8192;
export const SSL_OP_CRYPTOPRO_TLSEXT_BUG = 2147483648;
export const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS = 2048;
export const SSL_OP_LEGACY_SERVER_CONNECT = 4;
export const SSL_OP_NO_COMPRESSION = 131072;
export const SSL_OP_NO_ENCRYPT_THEN_MAC = 524288;
export const SSL_OP_NO_QUERY_MTU = 4096;
export const SSL_OP_NO_RENEGOTIATION = 1073741824;
export const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION = 65536;
export const SSL_OP_NO_SSLv2 = 0;
export const SSL_OP_NO_SSLv3 = 33554432;
export const SSL_OP_NO_TICKET = 16384;
export const SSL_OP_NO_TLSv1 = 67108864;
export const SSL_OP_NO_TLSv1_1 = 268435456;
export const SSL_OP_NO_TLSv1_2 = 134217728;
export const SSL_OP_NO_TLSv1_3 = 536870912;
export const SSL_OP_PRIORITIZE_CHACHA = 2097152;
export const SSL_OP_TLS_ROLLBACK_BUG = 8388608;
export const ENGINE_METHOD_RSA = 1;
export const ENGINE_METHOD_DSA = 2;
export const ENGINE_METHOD_DH = 4;
export const ENGINE_METHOD_RAND = 8;
export const ENGINE_METHOD_EC = 2048;
export const ENGINE_METHOD_CIPHERS = 64;
export const ENGINE_METHOD_DIGESTS = 128;
export const ENGINE_METHOD_PKEY_METHS = 512;
export const ENGINE_METHOD_PKEY_ASN1_METHS = 1024;
export const ENGINE_METHOD_ALL = 65535;
export const ENGINE_METHOD_NONE = 0;
export const DH_CHECK_P_NOT_SAFE_PRIME = 2;
export const DH_CHECK_P_NOT_PRIME = 1;
export const DH_UNABLE_TO_CHECK_GENERATOR = 4;
export const DH_NOT_SUITABLE_GENERATOR = 8;
export const RSA_PKCS1_PADDING = 1;
export const RSA_NO_PADDING = 3;
export const RSA_PKCS1_OAEP_PADDING = 4;
export const RSA_X931_PADDING = 5;
export const RSA_PKCS1_PSS_PADDING = 6;
export const RSA_PSS_SALTLEN_DIGEST = -1;
export const RSA_PSS_SALTLEN_MAX_SIGN = -2;
export const RSA_PSS_SALTLEN_AUTO = -2;
export const POINT_CONVERSION_COMPRESSED = 2;
export const POINT_CONVERSION_UNCOMPRESSED = 4;
export const POINT_CONVERSION_HYBRID = 6;
// Versions explicitly set to 0 to avoid version misdetections
export const defaultCoreCipherList = "";
export const defaultCipherList = "";
export const OPENSSL_VERSION_NUMBER = 0;
export const TLS1_VERSION = 0;
export const TLS1_1_VERSION = 0;
export const TLS1_2_VERSION = 0;
export const TLS1_3_VERSION = 0;

View file

@ -0,0 +1,78 @@
import type nodeCrypto from "node:crypto";
// ---- implemented Utils ----
export declare const webcrypto: unknown;
export declare const randomBytes: typeof nodeCrypto.randomBytes;
export declare const rng: unknown;
export declare const prng: unknown;
// ---- Constants ----
export declare const fips: typeof nodeCrypto.fips;
// ---- Unimplemented utils ----
export declare const checkPrime: unknown;
export declare const checkPrimeSync: unknown;
/** @deprecated https://nodejs.org/docs/latest/api/deprecations.html#dep0106-cryptocreatecipher-and-cryptocreatedecipher */
export declare const createCipher: undefined;
/** @deprecated https://nodejs.org/docs/latest/api/deprecations.html#dep0106-cryptocreatecipher-and-cryptocreatedecipher */
export declare const createDecipher: undefined;
export declare const pseudoRandomBytes: unknown;
export declare const createCipheriv: unknown;
export declare const createDecipheriv: unknown;
export declare const createDiffieHellman: unknown;
export declare const createDiffieHellmanGroup: unknown;
export declare const createECDH: unknown;
export declare const createHash: unknown;
export declare const createHmac: unknown;
export declare const createPrivateKey: unknown;
export declare const createPublicKey: unknown;
export declare const createSecretKey: unknown;
export declare const createSign: unknown;
export declare const createVerify: unknown;
export declare const diffieHellman: unknown;
export declare const generatePrime: unknown;
export declare const generatePrimeSync: unknown;
export declare const getCiphers: unknown;
export declare const getCipherInfo: unknown;
export declare const getCurves: unknown;
export declare const getDiffieHellman: unknown;
export declare const getHashes: unknown;
export declare const hkdf: unknown;
export declare const hkdfSync: unknown;
export declare const pbkdf2: unknown;
export declare const pbkdf2Sync: unknown;
export declare const generateKeyPair: unknown;
export declare const generateKeyPairSync: unknown;
export declare const generateKey: unknown;
export declare const generateKeySync: unknown;
export declare const privateDecrypt: unknown;
export declare const privateEncrypt: unknown;
export declare const publicDecrypt: unknown;
export declare const publicEncrypt: unknown;
export declare const randomFill: unknown;
export declare const randomFillSync: unknown;
export declare const randomInt: unknown;
export declare const scrypt: unknown;
export declare const scryptSync: unknown;
export declare const sign: unknown;
export declare const setEngine: unknown;
export declare const timingSafeEqual: unknown;
export declare const getFips: unknown;
export declare const setFips: unknown;
export declare const verify: unknown;
export declare const secureHeapUsed: unknown;
export declare const hash: unknown;
// ---- Unimplemented Classes ----
/** @deprecated https://nodejs.org/docs/latest/api/deprecations.html#dep0106-cryptocreatecipher-and-cryptocreatedecipher */
export declare const Cipher: typeof nodeCrypto.Cipher;
/** @deprecated https://nodejs.org/docs/latest/api/deprecations.html#dep0106-cryptocreatecipher-and-cryptocreatedecipher */
export declare const Decipher: typeof nodeCrypto.Decipher;
export declare const Certificate: typeof nodeCrypto.Certificate;
export declare const Cipheriv: typeof nodeCrypto.Cipheriv;
export declare const Decipheriv: typeof nodeCrypto.Decipheriv;
export declare const DiffieHellman: typeof nodeCrypto.DiffieHellman;
export declare const DiffieHellmanGroup: typeof nodeCrypto.DiffieHellmanGroup;
export declare const ECDH: typeof nodeCrypto.ECDH;
export declare const Hash: typeof nodeCrypto.Hash;
export declare const Hmac: typeof nodeCrypto.Hmac;
export declare const KeyObject: typeof nodeCrypto.KeyObject;
export declare const Sign: typeof nodeCrypto.Sign;
export declare const Verify: typeof nodeCrypto.Verify;
export declare const X509Certificate: typeof nodeCrypto.X509Certificate;

View file

@ -0,0 +1,110 @@
import { notImplemented, notImplementedClass } from "../../../_internal/utils.mjs";
import { getRandomValues } from "./web.mjs";
// limit of Crypto.getRandomValues()
// https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues
const MAX_RANDOM_VALUE_BYTES = 65536;
// ---- implemented Utils ----
export const webcrypto = new Proxy(globalThis.crypto, { get(_, key) {
if (key === "CryptoKey") {
return globalThis.CryptoKey;
}
if (typeof globalThis.crypto[key] === "function") {
// @ts-ignore
return globalThis.crypto[key].bind(globalThis.crypto);
}
return globalThis.crypto[key];
} });
export const randomBytes = (size, cb) => {
const bytes = Buffer.alloc(size, 0, undefined);
for (let generated = 0; generated < size; generated += MAX_RANDOM_VALUE_BYTES) {
getRandomValues(
// Use subarray to get a view of the buffer
Uint8Array.prototype.subarray.call(bytes, generated, generated + MAX_RANDOM_VALUE_BYTES)
);
}
if (typeof cb === "function") {
cb(null, bytes);
return undefined;
}
return bytes;
};
export const rng = randomBytes;
export const prng = randomBytes;
// ---- Constants ----
export const fips = false;
// ---- Unimplemented utils ----
export const checkPrime = /* @__PURE__ */ notImplemented("crypto.checkPrime");
export const checkPrimeSync = /* @__PURE__ */ notImplemented("crypto.checkPrimeSync");
/** @deprecated https://nodejs.org/docs/latest/api/deprecations.html#dep0106-cryptocreatecipher-and-cryptocreatedecipher */
export const createCipher = undefined;
/** @deprecated https://nodejs.org/docs/latest/api/deprecations.html#dep0106-cryptocreatecipher-and-cryptocreatedecipher */
export const createDecipher = undefined;
export const pseudoRandomBytes = /* @__PURE__ */ notImplemented("crypto.pseudoRandomBytes");
export const createCipheriv = /* @__PURE__ */ notImplemented("crypto.createCipheriv");
export const createDecipheriv = /* @__PURE__ */ notImplemented("crypto.createDecipheriv");
export const createDiffieHellman = /* @__PURE__ */ notImplemented("crypto.createDiffieHellman");
export const createDiffieHellmanGroup = /* @__PURE__ */ notImplemented("crypto.createDiffieHellmanGroup");
export const createECDH = /* @__PURE__ */ notImplemented("crypto.createECDH");
export const createHash = /* @__PURE__ */ notImplemented("crypto.createHash");
export const createHmac = /* @__PURE__ */ notImplemented("crypto.createHmac");
export const createPrivateKey = /* @__PURE__ */ notImplemented("crypto.createPrivateKey");
export const createPublicKey = /* @__PURE__ */ notImplemented("crypto.createPublicKey");
export const createSecretKey = /* @__PURE__ */ notImplemented("crypto.createSecretKey");
export const createSign = /* @__PURE__ */ notImplemented("crypto.createSign");
export const createVerify = /* @__PURE__ */ notImplemented("crypto.createVerify");
export const diffieHellman = /* @__PURE__ */ notImplemented("crypto.diffieHellman");
export const generatePrime = /* @__PURE__ */ notImplemented("crypto.generatePrime");
export const generatePrimeSync = /* @__PURE__ */ notImplemented("crypto.generatePrimeSync");
export const getCiphers = /* @__PURE__ */ notImplemented("crypto.getCiphers");
export const getCipherInfo = /* @__PURE__ */ notImplemented("crypto.getCipherInfo");
export const getCurves = /* @__PURE__ */ notImplemented("crypto.getCurves");
export const getDiffieHellman = /* @__PURE__ */ notImplemented("crypto.getDiffieHellman");
export const getHashes = /* @__PURE__ */ notImplemented("crypto.getHashes");
export const hkdf = /* @__PURE__ */ notImplemented("crypto.hkdf");
export const hkdfSync = /* @__PURE__ */ notImplemented("crypto.hkdfSync");
export const pbkdf2 = /* @__PURE__ */ notImplemented("crypto.pbkdf2");
export const pbkdf2Sync = /* @__PURE__ */ notImplemented("crypto.pbkdf2Sync");
export const generateKeyPair = /* @__PURE__ */ notImplemented("crypto.generateKeyPair");
export const generateKeyPairSync = /* @__PURE__ */ notImplemented("crypto.generateKeyPairSync");
export const generateKey = /* @__PURE__ */ notImplemented("crypto.generateKey");
export const generateKeySync = /* @__PURE__ */ notImplemented("crypto.generateKeySync");
export const privateDecrypt = /* @__PURE__ */ notImplemented("crypto.privateDecrypt");
export const privateEncrypt = /* @__PURE__ */ notImplemented("crypto.privateEncrypt");
export const publicDecrypt = /* @__PURE__ */ notImplemented("crypto.publicDecrypt");
export const publicEncrypt = /* @__PURE__ */ notImplemented("crypto.publicEncrypt");
export const randomFill = /* @__PURE__ */ notImplemented("crypto.randomFill");
export const randomFillSync = /* @__PURE__ */ notImplemented("crypto.randomFillSync");
export const randomInt = /* @__PURE__ */ notImplemented("crypto.randomInt");
export const scrypt = /* @__PURE__ */ notImplemented("crypto.scrypt");
export const scryptSync = /* @__PURE__ */ notImplemented("crypto.scryptSync");
export const sign = /* @__PURE__ */ notImplemented("crypto.sign");
export const setEngine = /* @__PURE__ */ notImplemented("crypto.setEngine");
export const timingSafeEqual = /* @__PURE__ */ notImplemented("crypto.timingSafeEqual");
export const getFips = /* @__PURE__ */ notImplemented("crypto.getFips");
export const setFips = /* @__PURE__ */ notImplemented("crypto.setFips");
export const verify = /* @__PURE__ */ notImplemented("crypto.verify");
export const secureHeapUsed = /* @__PURE__ */ notImplemented("crypto.secureHeapUsed");
export const hash = /* @__PURE__ */ notImplemented("crypto.hash");
// ---- Unimplemented Classes ----
/** @deprecated https://nodejs.org/docs/latest/api/deprecations.html#dep0106-cryptocreatecipher-and-cryptocreatedecipher */
export const Cipher = undefined;
/** @deprecated https://nodejs.org/docs/latest/api/deprecations.html#dep0106-cryptocreatecipher-and-cryptocreatedecipher */
export const Decipher = undefined;
export const Certificate = /* @__PURE__ */ notImplementedClass("crypto.Certificate");
export const Cipheriv = /* @__PURE__ */ notImplementedClass(
"crypto.Cipheriv"
// @ts-expect-error not typed yet
);
export const Decipheriv = /* @__PURE__ */ notImplementedClass(
"crypto.Decipheriv"
// @ts-expect-error not typed yet
);
export const DiffieHellman = /* @__PURE__ */ notImplementedClass("crypto.DiffieHellman");
export const DiffieHellmanGroup = /* @__PURE__ */ notImplementedClass("crypto.DiffieHellmanGroup");
export const ECDH = /* @__PURE__ */ notImplementedClass("crypto.ECDH");
export const Hash = /* @__PURE__ */ notImplementedClass("crypto.Hash");
export const Hmac = /* @__PURE__ */ notImplementedClass("crypto.Hmac");
export const KeyObject = /* @__PURE__ */ notImplementedClass("crypto.KeyObject");
export const Sign = /* @__PURE__ */ notImplementedClass("crypto.Sign");
export const Verify = /* @__PURE__ */ notImplementedClass("crypto.Verify");
export const X509Certificate = /* @__PURE__ */ notImplementedClass("crypto.X509Certificate");

View file

@ -0,0 +1,5 @@
// https://nodejs.org/api/crypto.html
// https://github.com/unjs/uncrypto
export declare const subtle: SubtleCrypto;
export declare const randomUUID: Crypto["randomUUID"];
export declare const getRandomValues: Crypto["getRandomValues"];

View file

@ -0,0 +1,9 @@
// https://nodejs.org/api/crypto.html
// https://github.com/unjs/uncrypto
export const subtle = globalThis.crypto?.subtle;
export const randomUUID = () => {
return globalThis.crypto?.randomUUID();
};
export const getRandomValues = (array) => {
return globalThis.crypto?.getRandomValues(array);
};