initial commit

This commit is contained in:
dude
2026-09-01 18:33:56 +00:00
commit c24449ee0a
2761 changed files with 302737 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _stream = require('stream');
var _crypto = require('crypto');
class RandomStream extends _stream.Readable {
constructor(max) {
super();
this.remainingBytes = max;
}
_read(requestedSize) {
if (this.remainingBytes === 0) return this.push(null);
const size = Math.min(this.remainingBytes, requestedSize);
this.remainingBytes -= size;
(0, _crypto.randomBytes)(size, (err, buf) => {
if (err) return this.emit('error', err);
this.push(buf);
});
}
}
exports.default = RandomStream;