MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / verify

Method verify

projects/JavaScript/proto/fbe.js:4858–4876  ·  view source on GitHub ↗

* Check if the set value is valid * @this {!FinalModelSet} * @returns {!number} Final model size or Number.MAX_SAFE_INTEGER in case of any error

()

Source from the content-addressed store, hash-verified

4856 * @returns {!number} Final model size or Number.MAX_SAFE_INTEGER in case of any error
4857 */
4858 verify () {
4859 if ((this._buffer.offset + this.fbeOffset + 4) > this._buffer.size) {
4860 return Number.MAX_SAFE_INTEGER
4861 }
4862
4863 let fbeSetSize = this.readUInt32(this.fbeOffset)
4864
4865 let size = 4
4866 this._model.fbeOffset = this.fbeOffset + 4
4867 for (let i = 0; i < fbeSetSize; i++) {
4868 let offset = this._model.verify()
4869 if (offset === Number.MAX_SAFE_INTEGER) {
4870 return Number.MAX_SAFE_INTEGER
4871 }
4872 this._model.fbeShift(offset)
4873 size += offset
4874 }
4875 return size
4876 }
4877
4878 /**
4879 * Get the set value

Callers

nothing calls this directly

Calls 3

readUInt32Method · 0.45
verifyMethod · 0.45
fbeShiftMethod · 0.45

Tested by

no test coverage detected