Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added vernam.rb and vigenere.rb #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

anastasiiiaaa
Copy link

@anastasiiiaaa anastasiiiaaa commented Nov 7, 2021

Added vernam_test.rb and vigenere_test.rb
Added vernam_test.rb and vigenere_test.rb

Added vernam_test.rb and vigenere_test.rb
Copy link
Contributor

@Wolwer1nE Wolwer1nE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, add docs.

length_str=str.length
arr=str.split(" ")
key_arr=string_to_bin(key)
res=Array.new()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

res = []

end
#vigenere decryption
def self.vigenere_decrypt(str,key)
alph=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, extract alph to class variable

Replaced res=Array.new() with res=[]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants