You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
434 B
20 lines
434 B
|
|
//define the key ordering for level-sublevelq |
|
|
|
//var join = '\x01', separate = '\x00' |
|
var join = '#', separate = '!' |
|
|
|
exports.encode = function (e) { |
|
return separate + e[0].join(join) + separate + e[1] |
|
} |
|
|
|
exports.decode = function (s) { |
|
var i = s.indexOf(separate, 1) |
|
return [s.substring(1, i).split(join).filter(Boolean), s.substring(++i)] |
|
} |
|
|
|
exports.buffer = false |
|
|
|
exports.lowerBound = '\x00' |
|
exports.upperBound = '\uffff' |
|
|
|
|