import codecs

codec_info = codecs.lookup('hex')
_encode_hex = codec_info.encode
_decode_hex = codec_info.decode


def _encode_hex_str(value):
    return _encode_hex(value)[0].decode()


class ContentDigest(bytes):
    @classmethod
    def from_sha256(cls, value):
        if value[:7] != 'sha256:':
            raise ValueError("Found unsupported digest type.", value)
        return cls(_decode_hex(value[7:])[0])

    def as_sha256(self):
        return 'sha256:{0}'.format(_encode_hex_str(self))

    __str__ = as_sha256

    def __repr__(self):
        return '<{0} {1}>'.format(self.__class__.__name__, self)

dacc9e660273a52b63a9b44d1b8f8e241d48a3bb
<mask token>


class ContentDigest(bytes):
    <mask token>

    def as_sha256(self):
        return 'sha256:{0}'.format(_encode_hex_str(self))
    <mask token>

    def __repr__(self):
        return '<{0} {1}>'.format(self.__class__.__name__, self)

<mask token>


class ContentDigest(bytes):

    @classmethod
    def from_sha256(cls, value):
        if value[:7] != 'sha256:':
            raise ValueError('Found unsupported digest type.', value)
        return cls(_decode_hex(value[7:])[0])

    def as_sha256(self):
        return 'sha256:{0}'.format(_encode_hex_str(self))
    __str__ = as_sha256

    def __repr__(self):
        return '<{0} {1}>'.format(self.__class__.__name__, self)

<mask token>


def _encode_hex_str(value):
    return _encode_hex(value)[0].decode()


class ContentDigest(bytes):

    @classmethod
    def from_sha256(cls, value):
        if value[:7] != 'sha256:':
            raise ValueError('Found unsupported digest type.', value)
        return cls(_decode_hex(value[7:])[0])

    def as_sha256(self):
        return 'sha256:{0}'.format(_encode_hex_str(self))
    __str__ = as_sha256

    def __repr__(self):
        return '<{0} {1}>'.format(self.__class__.__name__, self)

import codecs
codec_info = codecs.lookup('hex')
_encode_hex = codec_info.encode
_decode_hex = codec_info.decode


def _encode_hex_str(value):
    return _encode_hex(value)[0].decode()


class ContentDigest(bytes):

    @classmethod
    def from_sha256(cls, value):
        if value[:7] != 'sha256:':
            raise ValueError('Found unsupported digest type.', value)
        return cls(_decode_hex(value[7:])[0])

    def as_sha256(self):
        return 'sha256:{0}'.format(_encode_hex_str(self))
    __str__ = as_sha256

    def __repr__(self):
        return '<{0} {1}>'.format(self.__class__.__name__, self)

import codecs

codec_info = codecs.lookup('hex')
_encode_hex = codec_info.encode
_decode_hex = codec_info.decode


def _encode_hex_str(value):
    return _encode_hex(value)[0].decode()


class ContentDigest(bytes):
    @classmethod
    def from_sha256(cls, value):
        if value[:7] != 'sha256:':
            raise ValueError("Found unsupported digest type.", value)
        return cls(_decode_hex(value[7:])[0])

    def as_sha256(self):
        return 'sha256:{0}'.format(_encode_hex_str(self))

    __str__ = as_sha256

    def __repr__(self):
        return '<{0} {1}>'.format(self.__class__.__name__, self)
