base64 for javascript This implementation uses Uint8Array so that it works on both browser and nodejs.