A cable, comprising a first connector, intended to be connected to a charging station, a second connector, intended to be connected to a battery to be recharged of an electric or electrically-assisted bicycle, and electrical conductors for receiving a charging current, connected to first ends for receiving a charging current present in the first connector and to second ends for receiving a charging current present in the second connector, the cable comprising a circuit for generating a prescribed connection code, comprising a permanent memory, in which the prescribed connection code is recorded, and at least two code communication electrical conductors connected to at least two communication ends present in the first connector, the cable having at least two electrical conductors for detecting a prescribed supply voltage for the code generation circuit, which are connected to at least two ends for detecting the prescribed supply voltage for the code generation circuit present in the first connector, characterized in that the generation circuit having a detector of the prescribed electrical supply voltage for the code generation circuit, which is connected to the two electrical conductors for detecting the prescribed supply voltage for the code generation circuit, the generation circuit being configured to send the prescribed connection code to the two electrical code communication conductors when the detector of the prescribed electrical supply voltage for the code generation circuit has detected that the prescribed electrical supply voltage for the code generation circuit is present between the two electrical conductors for detecting the prescribed supply voltage for the code generation circuit, a value of the prescribed electrical supply voltage for the code generation circuit being pre-recorded in the permanent memory or in the detector, the detector comparing the electrical voltage present between the two electrical conductors for detecting the voltage to the prescribed electrical supply voltage for the code generation circuit pre-recorded in the permanent memory or in the detector, to provide in case of equality a signal indicating that the electrical voltage detector has detected the prescribed electrical supply voltage for the code generation circuit between the two electrical conductors for detecting the voltage and to provide in case of inequality a signal indicating that the electrical voltage detector has not detected the prescribed electrical supply voltage for the code generation circuit between the two electrical voltage detection conductors. the cable comprising a circuit for generating a prescribed connection code, comprising a permanent memory, in which the prescribed connection code is recorded, and at least two code communication electrical conductors connected to at least two communication ends present in the first connector, the cable having at least two electrical conductors for detecting a prescribed supply voltage for the code generation circuit, which are connected to at least two ends for detecting the prescribed supply voltage for the code generation circuit present in the first connector, characterized in that the generation circuit having a detector of the prescribed electrical supply voltage for the code generation circuit, which is connected to the two electrical conductors for detecting the prescribed supply voltage for the code generation circuit, the generation circuit being configured to send the prescribed connection code to the two electrical code communication conductors when the detector of the prescribed electrical supply voltage for the code generation circuit has detected that the prescribed electrical supply voltage for the code generation circuit is present between the two electrical conductors for detecting the prescribed supply voltage for the code generation circuit, a value of the prescribed electrical supply voltage for the code generation circuit being pre-recorded in the permanent memory or in the detector, the detector comparing the electrical voltage present between the two electrical conductors for detecting the voltage to the prescribed electrical supply voltage for the code generation circuit pre-recorded in the permanent memory or in the detector, to provide in case of equality a signal indicating that the electrical voltage detector has detected the prescribed electrical supply voltage for the code generation circuit between the two electrical conductors for detecting the voltage and to provide in case of inequality a signal indicating that the electrical voltage detector has not detected the prescribed electrical supply voltage for the code generation circuit between the two electrical voltage detection conductors.