JavaScript Base64 à longueur
var byteLength = parseInt((str).replace(/=/g,"").length * 0.75));
Disgusted Dugong
var byteLength = parseInt((str).replace(/=/g,"").length * 0.75));