18 lines
285 B
JavaScript
18 lines
285 B
JavaScript
'use strict'
|
|
|
|
const { Transform } = require('stream')
|
|
|
|
class ByteaEncoder extends Transform {
|
|
constructor () {
|
|
super()
|
|
this.push('\\\\x')
|
|
}
|
|
|
|
_transform (chunk, encoding, callback) {
|
|
this.push(chunk.toString('hex'))
|
|
callback()
|
|
}
|
|
}
|
|
|
|
module.exports = ByteaEncoder
|