Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Random Byte Array

A lightweight Python utility for generating random byte arrays.

Features

  • Simple, dependency-free implementation
  • Useful for testing, simulations, and data generation
  • Supports Python 2+

Installation

pip install random-byte-array

Usage

from random_byte_array import random_byte_array

# Generate a random bytearray
data = random_byte_array()
# Example output: bytearray(b'\x12\xa3\x7f\x00\xe4...')

How It Works

The algorithm:

  1. Generates values in range [0, 256]
  2. Appends values 0-255 as bytes
  3. Stops when encountering 256 (≈0.39% chance per iteration)

Average output size: ~255 bytes (geometric distribution)

Use Cases

  • Test data for binary protocols
  • Fuzz testing
  • Cryptographic simulations
  • Generating random binary payloads

Contributing

Contributions are welcome! Please submit pull requests or open issues on GitHub.

License

MIT

Release files for random-byte-array 0.1.0a0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for random-byte-array 0.1.0a0
File Size Uploaded
random_byte_array-0.1.0a0.tar.gz 2.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for random-byte-array 0.1.0a0
File Interpreter ABI Platform
random_byte_array-0.1.0a0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 5.6 kB

Release files / random_byte_array-0.1.0a0.tar.gz

Download URL random_byte_array-0.1.0a0.tar.gz
Size 2.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0d773cc1eaf07b6366d9815d75ed93310470ca3f20f72b5120b9d0ab791bd694
BLAKE2b-256 checksum
How to use checksums
b9697b0c7bb5db9138b4927ad5198f025386b4676b60ffe526e02d9ba0526ff0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.2

Release files / random_byte_array-0.1.0a0-py2.py3-none-any.whl

Download URL random_byte_array-0.1.0a0-py2.py3-none-any.whl
Size 3.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
b0207c2f27b314cce40268ecf379a82742b9c67755a1807b8713297df90c30c8
BLAKE2b-256 checksum
How to use checksums
e8fe5068117938a53e4ba0dcb1c8403b339d1f5744126d843be35a4e79722d64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

0.1.0a0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page