# -*- coding: utf-8 -*-# pylint: disable=line-too-long,consider-using-f-string"""CGA SEC=============.. module:: pcapkit.const.mh.cga_secThis module contains the constant enumeration for **CGA SEC**,which is automatically generated from :class:`pcapkit.vendor.mh.cga_sec.CGASec`."""fromaenumimportIntEnum,extend_enum__all__=['CGASec']
[docs]classCGASec(IntEnum):"""[CGASec] CGA SEC"""#: SHA-1_0hash2bits [:rfc:`4982`]SHA_1_0hash2bits=0b000#: SHA-1_16hash2bits [:rfc:`4982`]SHA_1_16hash2bits=0b001#: SHA-1_32hash2bits [:rfc:`4982`]SHA_1_32hash2bits=0b010@staticmethoddefget(key:'int | str',default:'int'=-1)->'CGASec':"""Backport support for original codes. Args: key: Key to get enum item. default: Default value if not found. :meta private: """ifisinstance(key,int):returnCGASec(key)ifkeynotinCGASec._member_map_:# pylint: disable=no-memberreturnextend_enum(CGASec,key,default)returnCGASec[key]# type: ignore[misc]
[docs]@classmethoddef_missing_(cls,value:'int')->'CGASec':"""Lookup function used when value is not found. Args: value: Value to get enum item. """ifnot(isinstance(value,int)and0<=value<=0b111):raiseValueError('%r is not a valid %s'%(value,cls.__name__))#: Unspecified in the IANA registryreturnextend_enum(cls,'Unassigned_%s'%bin(value)[2:],value)