Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
utf8-stream
Advanced tools
buffer utf8 characters that would otherwise span chunk boundaries
Here we'll write some chinese characters at random byte offsets:
var utf8Stream = require('utf8-stream');
var through = require('through');
var u8 = utf8Stream();
u8.pipe(through(function (buf) {
var s = buf.toString('utf8');
this.queue(s.split('').join('\n') + '\n');
})).pipe(process.stdout);
u8.write(Buffer([ 0xe9, 0x81 ]));
u8.write(Buffer([ 0x99, 0xe9, 0x81, 0xa0, 0xe6 ]));
u8.write(Buffer([ 0x9c, 0xaa, 0xe4, 0xbe ]));
u8.write(Buffer([ 0x86, 0xe7, 0x9a, 0x84, 0xe4, 0xba, 0x8b ]));
u8.write(Buffer([ 0xe4, 0xbb, 0xb6 ]));
u8.end();
Inside the through(function (buf) {})
, each buf
will never span a utf8
multi-byte character so we can just call .toString('utf8')
.
output:
遙
遠
未
來
的
事
件
var utf8Stream = require('utf8-stream')
Return a through stream u8
that will never emit a chunk that spans a utf8
multi-byte character.
With npm do:
npm install utf8-stream
MIT
FAQs
buffer utf8 characters that would otherwise span chunk boundaries
We found that utf8-stream demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.