Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

shard-computer

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shard-computer

A library for rapid computation of Neuroglancer Precomputed shard hashes.

  • 1.2.1
  • PyPI
  • Socket score

Maintainers
1

Automated Tests PyPI version

shard-computer

Perform accelerated shard hash computation for Neuroglancer Precomputed shards.

import shardcomputer

preshift_bits = 0
shard_bits = 11
minishard_bits = 8

label = 12949142

shard_no = shardcomputer.shard_number(label, preshift_bits, shard_bits, minishard_bits)

# let labels be a uint64 numpy array of labels
# e.g. set(['4d2'])
shard_no_set = shardcomputer.unique_shard_numbers(
	labels, preshift_bits, shard_bits, minishard_bits
)

# Returns shard number -> label list dict
# e.g. {'4d2': [12949142]}
shard_no_to_labels = shardcomputer.assign_labels_to_shards(
	label, preshift_bits, shard_bits, minishard_bits
)

Install

pip install shard-computer

Credits

Thank you to Austin Appleby for placing MurMurhash3 into the public domain.

Keywords

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