Socket
Socket
Sign inDemoInstall

listcrunch

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

listcrunch

A simple human-readable way to compress redundant sequential data


Maintainers
1

ListCrunch

A simple human-readable way to compress redundant sequential data.

Example

from listcrunch import crunch

compressed_string = crunch([1, 1, 1, 1, 1, 1, 1, 1, 1, 2])
# Returns '1:0-8;2:9', meaning 1 appears in indices 0-8 (inclusive),
# and 2 occurs at index 9.

To uncompress, use the uncrunch function.

from listcrunch import uncrunch

uncrunch('50:0-1,3-4;3:2,5;60:6;70:7-8')
# Returns ['50', '50', '3', '50', '50', '3', '60', '70', '70']

FAQs


Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc