from typing import List


def bip32_path_from_string(path: str) -> List[bytes]:
    """Convert BIP32 path string to list of bytes."""
    splitted_path: List[str] = path.split("/")

    if "m" in splitted_path and splitted_path[0] == "m":
        splitted_path = splitted_path[1:]

    return [int(p).to_bytes(4, byteorder="big") if "'" not in p
            else (0x80000000 | int(p[:-1])).to_bytes(4, byteorder="big")
            for p in splitted_path]