from typing import Sized
import random
import binascii


def generate_pad(message: Sized) -> bytes:
    """
    Generates the One Time Pad (OTP) to be used for encrypting the message.

    Arguments:
    message: bytes - the message to generate a pad for

    Returns:
    bytes - the randomly generated pad as a hex string

    i.e. a pad of [0x01, 0x02, 0xFE] would be b"0102FE"

    this is done to make printing the pad / encrypted data easier
    """

    # store the padding data in a list while we create it
    # this lets us append easily which is harder with a bytes object
    pad = []
    for i in range(len(message)):
        # for each character of the message add a new random number
        # between 0 and 255 for each character in the input
        pad.append(random.randint(0, 255))

    # convert the pad to bytes and then to its hex representation
    return binascii.hexlify(bytes(pad))