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

Function encodeBase128

packages/utils/crypto.ts:32–42  ·  view source on GitHub ↗
(value: number)

Source from the content-addressed store, hash-verified

30
31// Variable-length quantity encoding aka. base-128 encoding
32function encodeBase128(value: number): Buffer {
33 const bytes = [];
34 do {
35 let byte = value & 0x7f;
36 value >>>= 7;
37 if (bytes.length > 0)
38 byte |= 0x80;
39 bytes.push(byte);
40 } while (value > 0);
41 return Buffer.from(bytes.reverse());
42}
43
44// ASN1/DER Speficiation: https://www.itu.int/rec/T-REC-X.680-X.693-202102-I/en
45class DER {

Callers 1

Calls 2

pushMethod · 0.65
fromMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…