Skip to main content

Generate randoms strings of a given pattern

Project description

This is a small module for generating randoms strings of a given pattern. It is also capable of estimating various metrics for this pattern (probability of collision, estimated collision count and total variants count).

Installation

$ pip install funny-codes

Usage

>>> from funny_codes import FunnyCodes
>>> my_codes = FunnyCodes('TATAN-76')
>>> my_codes.next() # the following is a random code matching the pattern
HIPAS-12

>>> my_codes.next()
MOVER-87

>>> my_codes.variants_count()
20000844

>>> my_codes.collision_prob(1000)
0.024664677603280283

>>> my_codes.expected_collisions(10000)
2.499235797673464

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

funny-codes-1.0.tar.gz (2.7 kB view details)

Uploaded Source

File details

Details for the file funny-codes-1.0.tar.gz.

File metadata

  • Download URL: funny-codes-1.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for funny-codes-1.0.tar.gz
Algorithm Hash digest
SHA256 44cf92ab3e34f375b04656621463e50216ff1fe7e75afa816af3a556ecd93be3
MD5 a65b75064094c40d3fee218edf52867e
BLAKE2b-256 9beb7308a643728b5fc30546f4f77c74fc1b54207ba6277e0b64339cba818dd2

See more details on using hashes here.

Supported by

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