Answer the question
In order to leave comments, you need to log in
How to use encryption in NodeJs?
How to encrypt file contents in nodejs?
Now we have this code:
streamwrite = fs.createWriteStream(path);
streamread = fs.createReadStream('local');
streamread.on('readable', function() {
var data;
while(null !== (data = streamread.read(4096))){
var buf = new Buffer(data);
streamwrite.write(buf.toString( 'hex'));
delete data,buf;
}
});
streamread.on('end', function() {
});
streamread.on('error',function(er){
});
streamread.on('close', function() {
delete streamread;
});
When decrypting, it gives out a couple of characters in the form of krakozyabr, how to solve this problem?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question