MCPcopy Create free account
hub / github.com/TheAlgorithms/JavaScript / findCharIndex

Function findCharIndex

Ciphers/AffineCipher.js:60–62  ·  view source on GitHub ↗

* Find character index based on ASCII order * @param {String} char - Character index to be found * @return {Boolean} Character index

(char)

Source from the content-addressed store, hash-verified

58 * @return {Boolean} Character index
59 */
60function findCharIndex(char) {
61 return char.toUpperCase().charCodeAt(0) - 'A'.charCodeAt(0)
62}
63
64/**
65 * Encrypt a Affine Cipher

Callers 2

encryptFunction · 0.85
decryptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected