Server IP : 185.86.78.101 / Your IP : 216.73.216.124 Web Server : Apache System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /www/wwwroot/mifepriston.org/node_modules/buffer-fill/ |
Upload File : |
/* Node.js 6.4.0 and up has full support */ var hasFullSupport = (function () { try { if (!Buffer.isEncoding('latin1')) { return false } var buf = Buffer.alloc ? Buffer.alloc(4) : new Buffer(4) buf.fill('ab', 'ucs2') return (buf.toString('hex') === '61006200') } catch (_) { return false } }()) function isSingleByte (val) { return (val.length === 1 && val.charCodeAt(0) < 256) } function fillWithNumber (buffer, val, start, end) { if (start < 0 || end > buffer.length) { throw new RangeError('Out of range index') } start = start >>> 0 end = end === undefined ? buffer.length : end >>> 0 if (end > start) { buffer.fill(val, start, end) } return buffer } function fillWithBuffer (buffer, val, start, end) { if (start < 0 || end > buffer.length) { throw new RangeError('Out of range index') } if (end <= start) { return buffer } start = start >>> 0 end = end === undefined ? buffer.length : end >>> 0 var pos = start var len = val.length while (pos <= (end - len)) { val.copy(buffer, pos) pos += len } if (pos !== end) { val.copy(buffer, pos, 0, end - pos) } return buffer } function fill (buffer, val, start, end, encoding) { if (hasFullSupport) { return buffer.fill(val, start, end, encoding) } if (typeof val === 'number') { return fillWithNumber(buffer, val, start, end) } if (typeof val === 'string') { if (typeof start === 'string') { encoding = start start = 0 end = buffer.length } else if (typeof end === 'string') { encoding = end end = buffer.length } if (encoding !== undefined && typeof encoding !== 'string') { throw new TypeError('encoding must be a string') } if (encoding === 'latin1') { encoding = 'binary' } if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { throw new TypeError('Unknown encoding: ' + encoding) } if (val === '') { return fillWithNumber(buffer, 0, start, end) } if (isSingleByte(val)) { return fillWithNumber(buffer, val.charCodeAt(0), start, end) } val = new Buffer(val, encoding) } if (Buffer.isBuffer(val)) { return fillWithBuffer(buffer, val, start, end) } // Other values (e.g. undefined, boolean, object) results in zero-fill return fillWithNumber(buffer, 0, start, end) } module.exports = fill