MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / to_hex

Function to_hex

sdk/js/src/index.ts:114–122  ·  view source on GitHub ↗
(data: string | Buffer | Uint8Array)

Source from the content-addressed store, hash-verified

112}
113
114export function to_hex(data: string | Buffer | Uint8Array): string {
115 if (typeof data === 'string') {
116 return Buffer.from(data).toString('hex');
117 }
118 if (data instanceof Uint8Array) {
119 return Buffer.from(data).toString('hex');
120 }
121 return (data as Buffer).toString('hex');
122}
123
124function x509key_to_uint8array(pem: string, max_length?: number) {
125 const content = pem.replace(/-----BEGIN PRIVATE KEY-----/, '')

Callers 6

getQuoteMethod · 0.85
attestMethod · 0.85
emitEventMethod · 0.85
signMethod · 0.85
verifyMethod · 0.85
tdxQuoteMethod · 0.85

Calls 1

fromMethod · 0.45

Tested by

no test coverage detected