Alc utilities

The alc.util module contains some utility functions.

alc.util.imsi2str(imsi, /)

Decodes a TBCD encoded IMSI into a human readable string.

Parameters

imsi (bytes) – TBCD encoded imsi

Return type

str

alc.util.str2imsi(imsi, /)

Encodes a human readable IMSI into a TBCD encoded bytes object.

Parameters

imsi (str) – human readable IMSI str

Return type

bytes

alc.util.imsi_get_mnc(imsi, /)

Extracts the MNC from a TBCD encoded IMSI.

Parameters

imsi (bytes) – TBCD encoded IMSI

Return type

int

alc.util.imsi_get_mcc(imsi, /)

Extracts the MCC from a TBCD encoded IMSI.

Parameters

imsi (bytes) – TBCD encoded IMSI

Return type

int