1. encode-utf8
Turn a string into an ArrayBuffer by using the UTF8 encoding.
encode-utf8
Package: encode-utf8
Created by: LinusU
Last modified: Sun, 01 May 2022 07:37:44 GMT
Version: 2.0.0
License: MIT
Downloads: 7,055,489
Repository: https://github.com/LinusU/encode-utf8

Install

npm install encode-utf8
yarn add encode-utf8

Encode UTF8

Turn a string into an ArrayBuffer by using the UTF8 encoding.

Installation

 npm install --save encode-utf8

Usage

 import encodeUtf8 from 'encode-utf8'

console.log(encodeUtf8('Hello, World!'))
//=> ArrayBuffer { byteLength: 13 }

console.log(encodeUtf8('🐵 🙈 🙉 🙊'))
//=> ArrayBuffer { byteLength: 19 }

API

encodeUtf8(input)

  • input (string, required)
  • returns ArrayBuffer - an ArrayBuffer with the input string represented as UTF8 encoded data

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code