mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-21 05:50:55 +08:00
* Expand static three.js workflows and host integration * Preserve JavaScript class state in static three.js workflows * Preserve inferred JavaScript behavior across static workflows * Preserve inferred callables and native compatibility boundaries * Retain annotated JavaScript factory exports and bootstrap-safe call spreads * Preserve Buffer and child callback identities in static packages * Clarify JavaScript symbol spread support
21 lines
860 B
JavaScript
21 lines
860 B
JavaScript
const { pbkdf2, randomBytes } = require("node:crypto");
|
|
const { deflate, inflate } = require("node:zlib");
|
|
async function main() {
|
|
await new Promise(resolve => pbkdf2("password", "salt", 2, 8, "sha256", (error, value) => {
|
|
console.log(error === null, Buffer.isBuffer(value), value.toString("hex"));
|
|
resolve(undefined);
|
|
}));
|
|
await new Promise(resolve => randomBytes(4, (error, value) => {
|
|
console.log(error === null, Buffer.isBuffer(value), value.toString("hex").length);
|
|
resolve(undefined);
|
|
}));
|
|
await new Promise(resolve => deflate("hello", (error, compressed) => {
|
|
console.log(error === null, Buffer.isBuffer(compressed));
|
|
inflate(compressed, (failure, value) => {
|
|
console.log(failure === null, Buffer.isBuffer(value), value.toString("utf8"), value.toString("hex"));
|
|
resolve(undefined);
|
|
});
|
|
}));
|
|
}
|
|
main();
|