docs: def encode(value: hints.Buffer) -> str:
      """
      Encode the given :class:`~bytes` instance to a :class:`~str` using Base32 encoding.
  
      .. note:: You should only use this method if you've got a :class:`~bytes` instance
          and you are unsure of what it represents. If you know the the _meaning_ of the
          :class:`~bytes` instance, you should call the `encode_*` method explicitly for
          better performance.
  
      :param value: Bytes to encode
      :type value: :class:`~bytes`, :class:`~bytearray`, or :class:`~memoryview`
      :return: Value encoded as a Base32 string
      :rtype: :class:`~str`
      :raises ValueError: when the value is not 6, 10, or 16 bytes long
      """
      length = len(value)
  
      # Order here is based on assumed hot path.
      if length == 16:
          return encode_ulid(value)
      if length == 6:
          return encode_timestamp(value)
      if length == 10:
          return encode_randomness(value)
  
      raise ValueError('Expects bytes in sizes of 6, 10, or 16; got {}'.format(length))