BLUE
PHP 7.4.33
Path:
/var/www/gtechmarathon2026.bitkit.dk/httpdocs/node_modules/postgres-bytea
Run
Logout
Edit File
Size: 1.53 KB
Close
/var/www/gtechmarathon2026.bitkit.dk/httpdocs/node_modules/postgres-bytea/decoder.js
Text
Base64
'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
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 10
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
decode-test.js
411 B
lrw-r--r--
2025-07-10 12:54:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
decode.js
975 B
lrw-r--r--
2025-07-10 12:54:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
decoder-test.js
818 B
lrw-r--r--
2025-07-10 12:54:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
decoder.js
1.53 KB
lrw-r--r--
2025-07-10 12:54:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
encoder-test.js
774 B
lrw-r--r--
2025-07-10 12:54:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
encoder.js
285 B
lrw-r--r--
2025-07-10 12:54:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
140 B
lrw-r--r--
2025-07-10 12:54:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
license
1.08 KB
lrw-r--r--
2025-07-10 12:54:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
package.json
708 B
lrw-r--r--
2025-07-10 12:54:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
readme.md
2.48 KB
lrw-r--r--
2025-07-10 12:54:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).