Skip to main content

Iterate randomly over integer ranges

Project description

Shuffled: Random iterators for large integer ranges

Shuffled is a library for iterating randomly and without repetition over integer ranges. It doesn't store all the integers in memory so that you can work with ranges of up to 2128 elements, even with your standard RAM available.

>>> shuffled_range = Shuffled(10)
>>> list(shuffled_range)
[4, 1, 2, 9, 8, 5, 3, 0, 6, 7]
>>> same_shuffled_range = Shuffled(10, seed=shuffled_range.seed)
>>> list(same_shuffled_range)
[4, 1, 2, 9, 8, 5, 3, 0, 6, 7]
>>> network = ipaddress.IPv4Network('10.0.0.0/8')
>>> shuffled_range = Shuffled(network.num_addresses)
>>> for index in shuffled_range:
...     print(network[index])
...
10.24.41.126
10.67.199.15
10.240.82.199
10.79.219.74
10.166.105.25
10.19.5.91
[...]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shuffled-1.1.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shuffled-1.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file shuffled-1.1.0.tar.gz.

File metadata

  • Download URL: shuffled-1.1.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for shuffled-1.1.0.tar.gz
Algorithm Hash digest
SHA256 0997faab07b16641e50b8ea34505775573eedcda6ff7706992965032e83f4ac0
MD5 77747a780a2016dbda84c656840e8a8b
BLAKE2b-256 9c3cc221e96d00a1a5c9f3c10cfe3a9e3e8dc0fc19afae7b74e2d68a6cebf31e

See more details on using hashes here.

File details

Details for the file shuffled-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: shuffled-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for shuffled-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5d64d653b960fb8a0581e4353414ae566bad82f815608460d440e0ab7dcd31f4
MD5 25c8f225248b23f6d940355b5e2e22ef
BLAKE2b-256 e6f8f11ec759e9f1b7d22f8f5443387401423c43b2802c36b18c707014b9f1fb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page