.. _alc_dot_util: Alc utilities ============= The :mod:`alc.util` module contains some utility functions. .. module:: alc.util .. function:: imsi2str(imsi, /) Decodes a `TBCD`_ encoded IMSI into a human readable string. :param bytes imsi: TBCD encoded imsi :rtype: str .. function:: str2imsi(imsi, /) Encodes a human readable IMSI into a `TBCD`_ encoded bytes object. :param str imsi: human readable IMSI str :rtype: bytes .. function:: imsi_get_mnc(imsi, /) Extracts the MNC from a TBCD encoded IMSI. :param bytes imsi: TBCD encoded IMSI :rtype: int .. function:: imsi_get_mcc(imsi, /) Extracts the MCC from a TBCD encoded IMSI. :param bytes imsi: TBCD encoded IMSI :rtype: int .. _TBCD: https://en.wikipedia.org/wiki/Binary-coded_decimal#Telephony_binary-coded_decimal_(TBCD)