from typing import ByteString


def os2ip(x: ByteString) -> int:
    """
    OctetString to Integer Primitive:
    https://tools.ietf.org/html/rfc8017#section-4.2
    """
    return int.from_bytes(x, "big")