var bops = require('bops')

    
var consonants = 'bdfghjklmnprstvz'
//'bcdfghjklmnpqrst' //vwxyz'
var vowels = 'aiou'
//    0 1 2 3 4 5 6 7 8 9 A B C D E F
//    b d f g h j k l m n p r s t v z

exports.encode = toLetters
exports.decode = toBinary

function toLetters (b) {
  var s = ''
  for(var i = 0; i < b.length; i += 2) {
    var word = b[i] << 8 | b[i + 1]
    function Const () {
      var c = (word & 0xF000) >> 12
      word = word << 4
      return consonants[c]
    }
    function Vowel () {
      var c = (word & 0xC000) >> 14
      word = word << 2
      return vowels[c]
    }
    s += (!i ? '' : i%4 ? '-' : ' ') + Const() + Vowel() + Const() + Vowel() + Const()
  }
  return s
}

function toBinary (s) {
  s = s.replace(/[- ]/, '')
  var b = bops.create((s.length / 5) * 2)
  var word = 0
  function con (s) {
    word = word << 4 | consonants.indexOf(s)
  }
  function vo (s) {
    word = word << 2 | vowels.indexOf(s)
  }

  var i = 0
  while(s.length) {
    word = 0
    var a = s.substring(0, 5)
    con(a[0]); vo(a[1]); con(a[2]); vo(a[3]); con(a[4])
    b[i++] = word >> 8
    b[i++] = word & 0xff
    s = s.substring(5)
  }
  return b
}


@@ -1,37 +1,4 @@
-var bops = require('bops')%0A%0A    %0A
 var 
@@ -33,38 +33,8 @@
 vz'%0A
-//'bcdfghjklmnpqrst' //vwxyz'%0A
 var 
@@ -124,16 +124,181 @@
  s t v z
+%0A//    a i o u%0A%0Avar reverse = %7B%7D%0A%0Avar chars = consonants + vowels%0Afor(var i in consonants)%0A  reverse%5Bconsonants%5Bi%5D%5D = i%0Afor(var i in vowels)%0A  reverse%5Bvowels%5Bi%5D%5D = i
 %0A%0Aexport
@@ -343,16 +343,39 @@
 toBinary
+%0Aexports.buffer = false
 %0A%0Afuncti
@@ -405,16 +405,40 @@
 r s = ''
+, l = b.length, word = 0
 %0A  for(v
@@ -451,24 +451,17 @@
  0; i %3C 
-b.length
+l
 ; i += 2
@@ -468,20 +468,16 @@
 ) %7B%0A    
-var 
 word = b
@@ -500,46 +500,65 @@
  1%5D%0A
+%0A
     
-function Const () %7B%0A      var c = 
+s += (!i ? '' : i%254 ? '-' : ' ')%0A      + consonants%5B
 (wor
@@ -578,44 +578,59 @@
 %3E 12
+%5D
 %0A      
-word = word %3C%3C 4
++ vowels    %5B(word & 0x0C00) %3E%3E 10%5D
 %0A      
-return
++
  con
@@ -641,55 +641,8 @@
 nts%5B
-c%5D%0A    %7D%0A    function Vowel () %7B%0A      var c = 
 (wor
@@ -651,158 +651,105 @@
 & 0x
-C00
+03C
 0) %3E%3E 
-14%0A      word = word %3C%3C 2
+ 6%5D
 %0A      
-return
++
  vowels
-%5Bc%5D%0A    %7D%0A    s += (!i ? '' : i%254 ? '-' : ' ') + Const() + Vowel() + Const() + Vowel() + Const()
+    %5B(word & 0x0030) %3E%3E  4%5D%0A      + consonants%5B(word & 0x000F)      %5D%0A
 %0A  %7D
@@ -806,17 +806,18 @@
 lace(/%5B-
- 
+%5Cs
 %5D/, '')%0A
@@ -830,19 +830,18 @@
 b = 
-bops.create
+new Buffer
 ((s.
@@ -861,297 +861,250 @@
  2)%0A
+%0A
   var 
-word = 0%0A  function con (s) %7B%0A    word = word %3C%3C 4 %7C consonants.indexOf(s)%0A  %7D%0A  function vo (s) %7B%0A    word = word %3C%3C 2 %7C vowels.indexOf(s)%0A  %7D%0A%0A  var i = 0%0A  while(s.length) %7B%0A    word = 0%0A    var a = s.substring(0, 5)%0A    con(a%5B0%5D); vo(a%5B1%5D); con(a%5B2%5D); vo(a%5B3%5D); con(a%5B4%5D)
+i = 0, l = s.length, w = 0, word = 0%0A  for(var i =0; i %3C l; i += 5) %7B%0A    word = reverse%5Bs%5Bi%5D%5D   %3C%3C 12%0A         %7C reverse%5Bs%5Bi+1%5D%5D %3C%3C 10%0A         %7C reverse%5Bs%5Bi+2%5D%5D %3C%3C 6%0A         %7C reverse%5Bs%5Bi+3%5D%5D %3C%3C 4%0A         %7C reverse%5Bs%5Bi+4%5D%5D%0A
 %0A    b%5B
-i
+w
 ++%5D 
@@ -1121,17 +1121,17 @@
 8%0A    b%5B
-i
+w
 ++%5D = wo
@@ -1144,31 +1144,8 @@
 xff%0A
-    s = s.substring(5)%0A
   %7D%0A

improve perf