MCPcopy Create free account
hub / github.com/NomicFoundation/hardhat / utf8StringToBytes

Function utf8StringToBytes

packages/hardhat-utils/src/bytes.ts:50–52  ·  view source on GitHub ↗
(utf8String: string)

Source from the content-addressed store, hash-verified

48 * @returns A Uint8Array representing the byte sequence of the input UTF-8 string.
49 */
50export function utf8StringToBytes(utf8String: string): Uint8Array {
51 return new TextEncoder().encode(utf8String);
52}
53
54/**
55 * Converts a Uint8Array of UTF-8 encoded bytes into a string.

Callers 9

index.tsFile · 0.90
parsing.tsFile · 0.90
makeBuildInfoFunction · 0.90
makeBuildInfoFunction · 0.90
index.tsFile · 0.90
metadata.tsFile · 0.90
bytes.tsFile · 0.85
bytesIncludesUtf8StringFunction · 0.85
isValidChecksumFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected