• 
      

    Add utilities for random nonces/salts and encoding.

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

    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.
    b54c644d47afd3d89c5283bac0245b52ba435fd6
    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
    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. 
        
    chipx86
    david
    1. Ship It!
    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to master (fb70106)