How to use the pybase64._pybase64._get_simd_path function in pybase64

To help you get started, we’ve selected a few pybase64 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mayeut / pybase64 / pybase64 / __init__.py View on Github external
def get_version():
        """Returns pybase64 version as a :class:`str` object.

        The result reports if the C extension is used or not.
        e.g. `1.0.0 (C extension active - AVX2)`
        """
        if _has_extension:
            simd_name = None
            simd_flag = _get_simd_path()
            if simd_flag == 0:
                simd_name = 'No SIMD'
            elif simd_flag == 4:
                simd_name = 'SSSE3'
            elif simd_flag == 8:
                simd_name = 'SSE41'
            elif simd_flag == 16:
                simd_name = 'SSE42'
            elif simd_flag == 32:
                simd_name = 'AVX'
            elif simd_flag == 64:
                simd_name = 'AVX2'
            else:  # pragma: no branch
                simd_name = 'Unknown'  # pragma: no cover
            return __version__ + ' (C extension active - ' + simd_name + ')'
        return __version__ + ' (C extension inactive)'