Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
@shelf/fast-chunk-string
Advanced tools
Chunk string into equal substrings with unicode support
Credits to stackoverflow.com/a/29202760/2727317
$ yarn add @shelf/fast-chunk-string
const fastChunkString = require('@shelf/fast-chunk-string');
// the fastest way
fastChunkString('unicorns', {size: 2, unicodeAware: false});
// => ['un', 'ic', 'or', 'ns']
// ignore unicode, still fast but inaccurate
fastChunkString('😀😃😄😁', {size: 2, unicodeAware: false});
// => ['😀', '😃', '😄', '😁']
// respect unicode, slow but accurate
fastChunkString('😀😃😄😁', {size: 2, unicodeAware: true});
// => ['😀😃', '😄😁']
Run via yarn benchmark
~33 kb split by 2 kb x 1,246,204 ops/sec ±3.08% (75 runs sampled)
~33 kb split by 1 mb x 8,349,993 ops/sec ±0.63% (90 runs sampled)
~330 kb split by 2 kb x 155,141 ops/sec ±1.49% (81 runs sampled)
~330 kb split by 1 mb x 8,311,089 ops/sec ±1.92% (83 runs sampled)
~3.3 mb split by 2 kb x 15,827 ops/sec ±1.56% (86 runs sampled)
~3.3 mb split by 1 mb x 3,741,173 ops/sec ±1.14% (87 runs sampled)
~33 mb split by 2 kb x 1,579 ops/sec ±0.88% (84 runs sampled)
~33 mb split by 1 mb x 738,667 ops/sec ±0.38% (88 runs sampled)
~33 kb split by 2 kb with unicodeAware x 6.24 ops/sec ±2.67% (20 runs sampled)
~33 kb split by 1 mb with unicodeAware x 95.48 ops/sec ±1.01% (67 runs sampled)
~330 kb split by 2 kb with unicodeAware x 0.06 ops/sec ±5.09% (5 runs sampled)
~330 kb split by 1 mb with unicodeAware x 8.34 ops/sec ±3.33% (25 runs sampled)
MIT © Shelf
FAQs
Chunk string into equal substrings with unicode support
The npm package @shelf/fast-chunk-string receives a total of 430 weekly downloads. As such, @shelf/fast-chunk-string popularity was classified as not popular.
We found that @shelf/fast-chunk-string demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 56 open source maintainers 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
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.