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

Method encodeInteger

packages/utils/crypto.ts:49–52  ·  view source on GitHub ↗
(data: number)

Source from the content-addressed store, hash-verified

47 return this._encode(0x30, Buffer.concat(data));
48 }
49 static encodeInteger(data: number): Buffer {
50 assert(data >= -128 && data <= 127);
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

Callers 1

Calls 3

_encodeMethod · 0.95
assertFunction · 0.90
fromMethod · 0.45

Tested by

no test coverage detected