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

Function utf8StringToBytes

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

Source from the content-addressed store, hash-verified

55 * @returns A Uint8Array representing the byte sequence of the input UTF-8 string.
56 */
57export function utf8StringToBytes(utf8String: string): Uint8Array {
58 return new TextEncoder().encode(utf8String);
59}
60
61/**
62 * Converts a Uint8Array of UTF-8 encoded bytes into a string.

Callers 8

makeBuildInfoFunction · 0.90
index.tsFile · 0.90
keccakActionFunction · 0.90
metadata.tsFile · 0.90
bytes.tsFile · 0.85
bytesIncludesUtf8StringFunction · 0.85
toChecksumAddressFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected