https://github.com/sergeysova/utf8-uint8array
https://github.com/sergeysova/utf8-uint8array
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sergeysova/utf8-uint8array
- Owner: sergeysova
- Created: 2019-09-17T08:26:18.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T10:34:56.000Z (over 3 years ago)
- Last Synced: 2025-06-20T01:53:13.982Z (about 1 year ago)
- Language: JavaScript
- Homepage: https://npmjs.com/utf8-uint8array
- Size: 318 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# utf8-uint8array
## Installation
```bash
npm install utf8-uint8array
```
or
```bash
yarn add utf8-uint8array
```
## Encode UTF-8 string as Uint8Array
```ts
import { toBytes } from "utf8-uint8array";
const bytes: Uint8Array = toBytes("Привет 🌎");
```
## Decode Uint8Array as UTF-8 string
```ts
import { fromBytes } from "utf8-uint8array";
const bytes: Uint8Array;
const string: string = fromBytes(bytes);
```