MCPcopy Create free account
hub / github.com/LibPDF-js/core / stringToBytes

Function stringToBytes

src/test-utils.ts:146–148  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

144 * @returns Uint8Array of the string's bytes
145 */
146export function stringToBytes(str: string) {
147 return new Uint8Array(str.split("").map(c => c.charCodeAt(0)));
148}
149
150/**
151 * Create a Uint8Array from hex string (for creating test data).

Callers 3

index.test.tsFile · 0.90
scanner.test.tsFile · 0.90

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected