tfchain/encoders/rivine.py
def add_slice(self, value):
        """
        Encode an iterateble value as a slice,
        as specified by the rivbin encoding specification.

        @param value: the iterateble object to be rivbin-encoded as a slice
        """
        if isinstance(value, str):
            self._add_slice_length(len(value))
            self._data += value.encode('utf-8')
        elif isinstance(value, (bytes, bytearray)):
            self._add_slice_length(len(value))
            self._data += value
        else:
            length = 0
            for _ in value:
                length += 1
            self._add_slice_length(length)
            self.add_array(value)

        Encode an iterateble value as a slice,
        as specified by the rivbin encoding specification.

        @param value: the iterateble object to be rivbin-encoded as a slice
        
Encode an iterateble value as a slice,
as specified by the rivbin encoding specification.
Encode an iterateble value as a slice as specified by the rivbin encoding specification .
def add_slice(self, value):
        if isinstance(value, str):
            self._add_slice_length(len(value))
            self._data += value.encode('utf-8')
        elif isinstance(value, (bytes, bytearray)):
            self._add_slice_length(len(value))
            self._data += value
        else:
            length = 0
            for _ in value:
                length += 1
            self._add_slice_length(length)
            self.add_array(value)
def add_slice ( self , value ) : if isinstance ( value , str ) : self . _add_slice_length ( len ( value ) ) self . _data += value . encode ( 'utf-8' ) elif isinstance ( value , ( bytes , bytearray ) ) : self . _add_slice_length ( len ( value ) ) self . _data += value else : length = 0 for _ in value : length += 1 self . _add_slice_length ( length ) self . add_array ( value )
Encode an iterateble value as a slice,
as specified by the rivbin encoding specification.
Encode an iterateble value as a slice as specified by the rivbin encoding specification .
"""
        Encode an iterateble value as a slice,
        as specified by the rivbin encoding specification.

        @param value: the iterateble object to be rivbin-encoded as a slice
        """
self
value
the iterateble object to be rivbin-encoded as a slice
the iterateble object to be rivbin - encoded as a slice