MCPcopy Create free account
hub / github.com/cryptii/cryptii / _calcT

Method _calcT

src/Encoder/Bootstring.js:390–397  ·  view source on GitHub ↗

* Chooses the next T value based on given parameters. * @param {number} k * @param {number} bias * @param {number} tmin * @param {number} tmax * @return {number}

(k, bias, tmin, tmax)

Source from the content-addressed store, hash-verified

388 * @return {number}
389 */
390 _calcT (k, bias, tmin, tmax) {
391 if (k <= bias + tmin) {
392 return tmin
393 } else if (k >= bias + tmax) {
394 return tmax
395 }
396 return k - bias
397 }
398
399 /**
400 * Checks wether the given code point is considered to be basic.

Callers 2

performEncodeMethod · 0.95
performDecodeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected