• 
      

    Add utilities for random nonces/salts and encoding.

    Review Request #15173 — Created July 16, 2026 and updated

    Information

    cryptozoology
    master

    Reviewers

    This introduces new cryptozoology.utils.encoding and
    cryptozoology.utils.random modules.

    encoding provides utilities for encoding to/decoding from URL-safe
    Base64 with padding removed and type checking agdded. It also provides
    encoding for length-prefixed strings, which is useful in AAD and HKDF
    information.

    random provides types and generation for nonces and salts of arbitrary
    or common sizes.

    Unit tests pass.

    Made use of these in other changes.

    Summary ID
    Add utilities for random nonces/salts and encoding.
    This introduces new `cryptozoology.utils.encoding` and `cryptozoology.utils.random` modules. `encoding` provides utilities for encoding to/decoding from URL-safe Base64 with padding removed and type checking agdded. It also provides encoding for length-prefixed strings, which is useful in AAD and HKDF information. `random` provides types and generation for nonces and salts of arbitrary or common sizes.
    d0d17151f6f670421c80ea9db5d64f2f734aa3ca
    Description From Last Updated

    'struct' imported but unused Column: 1 Error code: F401

    reviewbot reviewbot

    Missing "Version Added". Same for the other methods here.

    david david

    Missing "Version Added"

    david david
    Checks run (1 failed, 1 succeeded)
    flake8 failed.
    JSHint passed.

    flake8

    chipx86
    Review request changed
    Change Summary:
    • Removed an unused import.
    • Added the missing utils/__init__.py module.
    Commits:
    Summary ID
    Add utilities for random nonces/salts and encoding.
    This introduces new `cryptozoology.utils.encoding` and `cryptozoology.utils.random` modules. `encoding` provides utilities for encoding to/decoding from URL-safe Base64 with padding removed and type checking agdded. It also provides encoding for length-prefixed strings, which is useful in AAD and HKDF information. `random` provides types and generation for nonces and salts of arbitrary or common sizes.
    60eb6b41097d6044ad48b00193a688b58cb6dcd3
    Add utilities for random nonces/salts and encoding.
    This introduces new `cryptozoology.utils.encoding` and `cryptozoology.utils.random` modules. `encoding` provides utilities for encoding to/decoding from URL-safe Base64 with padding removed and type checking agdded. It also provides encoding for length-prefixed strings, which is useful in AAD and HKDF information. `random` provides types and generation for nonces and salts of arbitrary or common sizes.
    d0d17151f6f670421c80ea9db5d64f2f734aa3ca

    Checks run (2 succeeded)

    flake8 passed.
    JSHint passed.
    david
    1. 
        
    2. cryptozoology/utils/random.py (Diff revision 2)
       
       
      Show all issues

      Missing "Version Added". Same for the other methods here.

    3. Show all issues

      Missing "Version Added"

    4.