MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / getLength

Method getLength

modules/crypt/etc/ber.js:56–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54 return this.#a[this.#i++];
55 }
56 getLength() {
57 let length = this.#a[this.#i++];
58 if (length < 128)
59 return length;
60
61 length &= 0x7F;
62 if (!length)
63 return -1; // indefinite length
64
65 let result = 0;
66 while (length--)
67 result = (result << 8) | this.#a[this.#i++];
68
69 return result;
70 }
71 peek() {
72 return this.#a[this.#i];
73 }

Callers 15

nextMethod · 0.95
getIntegerMethod · 0.95
getBitStringMethod · 0.95
getOctetStringMethod · 0.95
getObjectIdentifierMethod · 0.95
getSequenceMethod · 0.95
parseMethod · 0.95
decryptMethod · 0.95
decodeFunction · 0.95
decodeTBSFunction · 0.95
decodeAKIFunction · 0.95
parseMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected