def toBytes(string, length):
    """Converts a string into shift-jis encoding and padding it with zeroes to the specified length"""
    encoded = string.encode("shift-jis")
    return encoded + (b"\x00" * (length - len(encoded)))