MCPcopy
hub / github.com/microsoft/playwright / encodeObjectIdentifier

Method encodeObjectIdentifier

packages/utils/crypto.ts:53–63  ·  view source on GitHub ↗
(oid: string)

Source from the content-addressed store, hash-verified

51 return this._encode(0x02, Buffer.from([data]));
52 }
53 static encodeObjectIdentifier(oid: string): Buffer {
54 const parts = oid.split('.').map(v => Number(v));
55 // Encode the second part, which could be large, using base-128 encoding if necessary
56 const output = [encodeBase128(40 * parts[0] + parts[1])];
57
58 for (let i = 2; i < parts.length; i++)
59 output.push(encodeBase128(parts[i]));
60
61
62 return this._encode(0x06, Buffer.concat(output));
63 }
64 static encodeNull(): Buffer {
65 return Buffer.from([0x05, 0x00]);
66 }

Callers 1

Calls 4

_encodeMethod · 0.95
encodeBase128Function · 0.85
splitMethod · 0.80
pushMethod · 0.65

Tested by

no test coverage detected