feat(btoa): port and modify from Array.findindex