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

Method randomizeInterceptValue

src/Encoder/AffineCipher.js:226–233  ·  view source on GitHub ↗

* Generates a random intercept setting value. * @protected * @param {Random} random Random instance * @param {Setting} setting Setting instance * @return {string} Random intercept setting value

(random, setting)

Source from the content-addressed store, hash-verified

224 * @return {string} Random intercept setting value
225 */
226 randomizeInterceptValue (random, setting) {
227 const alphabetSetting = this.getSetting('alphabet')
228 if (alphabetSetting.isValid()) {
229 const m = this.getSetting('alphabet').getValue().getLength()
230 return random.nextInteger(1, m - 1)
231 }
232 return null
233 }
234}

Callers

nothing calls this directly

Calls 5

getSettingMethod · 0.80
nextIntegerMethod · 0.80
isValidMethod · 0.45
getLengthMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected