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

@aws-sdk/util-utf8

Package Overview
Dependencies
Maintainers
5
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/util-utf8

A UTF-8 string <-> UInt8Array converter

  • 3.303.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created

What is @aws-sdk/util-utf8?

@aws-sdk/util-utf8 is a utility package from AWS SDK for JavaScript that provides functions to encode and decode UTF-8 strings. It is particularly useful when working with AWS services that require UTF-8 encoding.

What are @aws-sdk/util-utf8's main functionalities?

UTF-8 Encoding

This feature allows you to encode a string into UTF-8 format. The `toUtf8` function takes a string as input and returns its UTF-8 encoded version.

const { toUtf8 } = require('@aws-sdk/util-utf8');
const utf8Encoded = toUtf8('Hello, World!');
console.log(utf8Encoded);

UTF-8 Decoding

This feature allows you to decode a UTF-8 encoded array back into a string. The `fromUtf8` function takes a Uint8Array as input and returns the decoded string.

const { fromUtf8 } = require('@aws-sdk/util-utf8');
const utf8Decoded = fromUtf8(new Uint8Array([72, 101, 108, 108, 111, 44, 32, 87, 111, 114, 108, 100, 33]));
console.log(utf8Decoded);

Other packages similar to @aws-sdk/util-utf8

FAQs

Package last updated on 30 Mar 2023

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