Skip to main content
Version: v3+

stringToBuffer

Start from API_LEVEL 4.0 . Please refer to API_LEVEL.

Convert string type to ArrayBuffer type.

Type

function stringToBuffer(str: InputString): Result

Parameters

InputString

TypeDescription
stringThe string to be converted

Result

TypeDescription
ArrayBufferThe converted ArrayBuffer

Example

import { stringToBuffer } from '@zos/utils'

const buffer = stringToBuffer('Hello Zepp OS')