6bit-encoder.js
function encode3(n) {
  assert(0 <= n && n <= 0x3ffff, ENCODE_OUTOFBOUNDS + n)
  // 18 bits -> 3 digits
  const lower = isolate(n, 0, 6)
  const mid = isolate(n, 6, 6)
  const upper = isolate(n, 12, 6)
  return encode(upper) + encode(mid) + encode(lower)
}
function encode3(n) {
  assert(0 <= n && n <= 0x3ffff, ENCODE_OUTOFBOUNDS + n)
  // 18 bits -> 3 digits
  const lower = isolate(n, 0, 6)
  const mid = isolate(n, 6, 6)
  const upper = isolate(n, 12, 6)
  return encode(upper) + encode(mid) + encode(lower)
}
function encode3 ( n ) { assert ( 0 <= n && n <= 0x3ffff , ENCODE_OUTOFBOUNDS + n ) // 18 bits -> 3 digits const lower = isolate ( n , 0 , 6 ) const mid = isolate ( n , 6 , 6 ) const upper = isolate ( n , 12 , 6 ) return encode ( upper ) + encode ( mid ) + encode ( lower ) }
Encodes a 18 bit number into three URL safe chars

@name encode3

@param {Number} n a 18 bit number
@returns {String} the chars
Encodes a 18 bit number into three URL safe chars