I have successfully decrypted a sensitive data using nodejs crypto library.
The problem is that the decrypted data has a trailing non-ascii characters.
How do I trim that?
My current trim function I below does not do the job.
String.prototype.fulltrim = function () {
return this.replace( /(?:(?:^|\n)\s+|\s+(?:$|\n))/g, '' ).replace( /\s+/g, ' ' );
};