Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

uint8-encoding

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uint8-encoding

Uint8 encoding, a simple way to convert strings to Uint8Arrays and vice versa.

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
981
decreased by-19.92%
Maintainers
1
Weekly downloads
 
Created
Source

Uint8 Encoding

Uint8 encoding, a simple way to convert strings to Uint8Arrays and vice versa.

Features

It's just a simple wrapper around TextEncoder and TextDecoder, but it provides a cleaner API and it handles nuances like the BOM character for you.

Install

npm install --save uint8-encoding

Usage

import U8 from 'uint8-encoding';

const raw = 'Hello 😃';
const encoded = U8.encode ( raw );
console.log ( encoded ); // => Uint8Array(10) [72, 101, 108, 108, 111,  32, 240, 159, 152, 131]

const decoded = U8.decode ( encoded );
console.log ( decoded ); // => 'Hello 😃'

License

MIT © Fabio Spampinato

Keywords

FAQs

Package last updated on 05 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc