MCPcopy Index your code
hub / github.com/Effect-TS/effect / encodeHexBytes

Function encodeHexBytes

packages/opentelemetry/src/internal/protobuf.ts:86–92  ·  view source on GitHub ↗
(hex: string)

Source from the content-addressed store, hash-verified

84 * Encodes bytes as a hex string to Uint8Array
85 */
86export const encodeHexBytes = (hex: string): Uint8Array => {
87 const bytes = new Uint8Array(hex.length / 2)
88 for (let i = 0; i < hex.length; i += 2) {
89 bytes[i / 2] = parseInt(hex.slice(i, i + 2), 16)
90 }
91 return bytes
92}
93
94/**
95 * Concatenates multiple Uint8Arrays

Callers 1

bytesFieldFromHexFunction · 0.85

Calls 1

parseIntFunction · 0.85

Tested by

no test coverage detected