util.js
function encodeBound(data, base) {
  var prefix = data.prefix
  var buffer = prefix ? base.encode(prefix, null) : new Buffer([ data.byte ])

  if (data.upper)
    buffer = Buffer.concat([ buffer, new Buffer([ 0xff ]) ])

  return util.encodedBound(data, buffer)
}
function encodeBound(data, base) {
  var prefix = data.prefix
  var buffer = prefix ? base.encode(prefix, null) : new Buffer([ data.byte ])

  if (data.upper)
    buffer = Buffer.concat([ buffer, new Buffer([ 0xff ]) ])

  return util.encodedBound(data, buffer)
}
function encodeBound ( data , base ) { var prefix = data . prefix var buffer = prefix ? base . encode ( prefix , null ) : new Buffer ( [ data . byte ] ) if ( data . upper ) buffer = Buffer . concat ( [ buffer , new Buffer ( [ 0xff ] ) ] ) return util . encodedBound ( data , buffer ) }
helpers for encoding boundary types
helpers for encoding boundary types