added safebuf base64decode func