Added CoffeeScript

This commit is contained in:
JMRaich 2022-05-21 14:38:46 +02:00
parent 2e36ac5081
commit af87286cb2
2 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,16 @@
encryptDecrypt = (input) ->
key = ['K', 'C', 'Q'] #Can be any chars, and any size array
output = ""
i = 0
while i < input.length
charCode = input.charCodeAt(i) ^ key[i % key.length].charCodeAt(0)
output += String.fromCharCode charCode
i++
return output
encrypted = encryptDecrypt "kylewbanks.com"
console.log("Encrypted:" + encrypted)
decrypted = encryptDecrypt encrypted
console.log("Decrypted:" + decrypted)

View File

@ -12,6 +12,7 @@ Simple implementation of XOR Encryption/Decrypting in various languages, includi
- [Groovy](Groovy/XOREncryption.groovy)
- [Java \(Android Compatible\)](Java%20\(Android%20compatible\)/XOREncryption.java)
- [JavaScript \(Node.js Compatible\)](JavaScript/XOREncryption.js)
- [CoffeeScript](CoffeeScript/XOREncryption.coffee)
- [Kotlin](Kotlin/XOREncryption.kt)
- [Objective-C](Objective-C/main.m)
- [PHP](PHP/XOREncryption.php)