{"id":13724911,"url":"https://github.com/WebReflection/uint8-to-base64","last_synced_at":"2025-05-07T19:31:18.717Z","repository":{"id":57385379,"uuid":"241354805","full_name":"WebReflection/uint8-to-base64","owner":"WebReflection","description":"A safe Uint8Array to base64 string converter","archived":false,"fork":false,"pushed_at":"2022-08-17T08:17:55.000Z","size":12,"stargazers_count":30,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T23:58:09.841Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WebReflection.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-18T12:24:56.000Z","updated_at":"2025-02-11T15:51:04.000Z","dependencies_parsed_at":"2022-09-14T18:01:00.208Z","dependency_job_id":null,"html_url":"https://github.com/WebReflection/uint8-to-base64","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fuint8-to-base64","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fuint8-to-base64/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fuint8-to-base64/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fuint8-to-base64/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebReflection","download_url":"https://codeload.github.com/WebReflection/uint8-to-base64/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252943714,"owners_count":21829295,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T01:02:06.372Z","updated_at":"2025-05-07T19:31:13.695Z","avatar_url":"https://github.com/WebReflection.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# A safe Uint8Array to base64 string converter\n\n[![Build Status](https://travis-ci.com/WebReflection/uint8-to-base64.svg?branch=master)](https://travis-ci.com/WebReflection/uint8-to-base64) [![Coverage Status](https://coveralls.io/repos/github/WebReflection/uint8-to-base64/badge.svg?branch=master)](https://coveralls.io/github/WebReflection/uint8-to-base64?branch=master)\n\n\u003csup\u003e**Social Media Photo by [Suzanne D. Williams](https://unsplash.com/@scw1217) on [Unsplash](https://unsplash.com/)**\u003c/sup\u003e\n\nCompatible with any binary data and every modern JS engine.\n\n```js\nimport {encode, decode} from 'uint8-to-base64';\n// const {encode, decode} = require('uint8-to-base64');\n\nconst utf8Binary = new Uint8Array(anyArrayBuffer);\n\n// encode converts Uint8Array instances to base64 strings\nconst encoded = encode(utf8Binary);\n\n// it's just like any other string\nconsole.log(encoded);\n\n// decode converts base64 strings, encoded via this module,\n// into their original Uint8Array representation\nconst decoded = decode(encoded);\n\nconsole.assert(\n  JSON.stringify([...utf8Binary]) ===\n  JSON.stringify([...decoded]),\n  'safe Uint8Array to utf-16 conversion'\n);\n```\n\n**Please note** this module requires global `atob` and `btoa` in NodeJS **\u003c 16**, polyfilled in old tests in here as such.\n\n```js\nglobal.btoa = str =\u003e Buffer.from(str).toString('base64');\nglobal.atob = str =\u003e Buffer.from(str, 'base64').toString();\n```\n\nLooking for a drop in module that converts into utf-16 strings instead? Check [uint8-to-utf16](https://github.com/WebReflection/uint8-to-utf16#readme) out!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWebReflection%2Fuint8-to-base64","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FWebReflection%2Fuint8-to-base64","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWebReflection%2Fuint8-to-base64/lists"}