Reference about RLE ASCII coding

Hello,
the masks in soloV2 prediction are coded in ASCII RLE, have you a reference explaining how it works please ?
Thank you
Best regards

Apparently it uses the pycocotools mask encode/decode but I am curious, how it works please ?