Class: YoutubeAudio::Decipher
- Inherits:
-
Object
- Object
- YoutubeAudio::Decipher
- Defined in:
- lib/youtube_audio/decipher.rb
Instance Method Summary collapse
Instance Method Details
#decipher(cipher) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/youtube_audio/decipher.rb', line 6 def decipher(cipher) decipher = cipher.split('') pb(decipher, 35) pb(decipher, 30) wh(decipher) pb(decipher, 2) decipher = p7(decipher, 3) wh(decipher) pb(decipher, 8) decipher = p7(decipher, 2) decipher.join('') end |
#p7(a, b) ⇒ Object
30 31 32 33 |
# File 'lib/youtube_audio/decipher.rb', line 30 def p7(a, b) result = a.slice(b, a.length) result end |
#pb(a, b) ⇒ Object
19 20 21 22 23 |
# File 'lib/youtube_audio/decipher.rb', line 19 def pb(a, b) c = a[0] a[0] = a[b % a.length] a[b % a.length] = c end |
#wh(a) ⇒ Object
25 26 27 28 |
# File 'lib/youtube_audio/decipher.rb', line 25 def wh(a) result = a.reverse! result end |