6bit-encoder.js
function encode5(n) {
  assert(0 <= n && n <= 0x3fffffff, ENCODE_OUTOFBOUNDS + n)
  // 30 bits -> 5 digits
  const lower = isolate(n, 0, 6)
  const aboveLower = isolate(n, 6, 6)
  const mid = isolate(n, 12, 6)
  const belowUpper = isolate(n, 18, 6)
  const upper = isolate(n, 24, 6)
  return encode(upper) + encode(belowUpper)
    + encode(mid) + encode(aboveLower) + encode(lower)
}
function encode5(n) {
  assert(0 <= n && n <= 0x3fffffff, ENCODE_OUTOFBOUNDS + n)
  // 30 bits -> 5 digits
  const lower = isolate(n, 0, 6)
  const aboveLower = isolate(n, 6, 6)
  const mid = isolate(n, 12, 6)
  const belowUpper = isolate(n, 18, 6)
  const upper = isolate(n, 24, 6)
  return encode(upper) + encode(belowUpper)
    + encode(mid) + encode(aboveLower) + encode(lower)
}
function encode5 ( n ) { assert ( 0 <= n && n <= 0x3fffffff , ENCODE_OUTOFBOUNDS + n ) // 30 bits -> 5 digits const lower = isolate ( n , 0 , 6 ) const aboveLower = isolate ( n , 6 , 6 ) const mid = isolate ( n , 12 , 6 ) const belowUpper = isolate ( n , 18 , 6 ) const upper = isolate ( n , 24 , 6 ) return encode ( upper ) + encode ( belowUpper ) + encode ( mid ) + encode ( aboveLower ) + encode ( lower ) }
Encodes a 30 bit number into five URL safe chars

@name encode5

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