Merge pull request #22 from JMRaichDev/master

Added CoffeeScript
This commit is contained in:
Kyle Banks 2022-05-23 12:58:30 +01:00 committed by GitHub
commit 7ce088b67f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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) - [Groovy](Groovy/XOREncryption.groovy)
- [Java \(Android Compatible\)](Java%20\(Android%20compatible\)/XOREncryption.java) - [Java \(Android Compatible\)](Java%20\(Android%20compatible\)/XOREncryption.java)
- [JavaScript \(Node.js Compatible\)](JavaScript/XOREncryption.js) - [JavaScript \(Node.js Compatible\)](JavaScript/XOREncryption.js)
- [CoffeeScript](CoffeeScript/XOREncryption.coffee)
- [Kotlin](Kotlin/XOREncryption.kt) - [Kotlin](Kotlin/XOREncryption.kt)
- [Objective-C](Objective-C/main.m) - [Objective-C](Objective-C/main.m)
- [PHP](PHP/XOREncryption.php) - [PHP](PHP/XOREncryption.php)