MCPcopy Index your code
hub / github.com/microsoft/playwright / encodeBitString

Method encodeBitString

packages/utils/crypto.ts:78–83  ·  view source on GitHub ↗
(data: Buffer)

Source from the content-addressed store, hash-verified

76 return this._encode(0x13, Buffer.from(data));
77 }
78 static encodeBitString(data: Buffer): Buffer {
79 // The first byte of the content is the number of unused bits at the end
80 const unusedBits = 0; // Assuming all bits are used
81 const content = Buffer.concat([Buffer.from([unusedBits]), data]);
82 return this._encode(0x03, content);
83 }
84 static encodeDate(date: Date): Buffer {
85 const year = date.getUTCFullYear();
86 const isGeneralizedTime = year >= 2050;

Callers 1

Calls 2

_encodeMethod · 0.95
fromMethod · 0.45

Tested by

no test coverage detected