"use strict"; const orderableVarint = require("../../packages/orderable-varint"); module.exports = { encode: function (number, _asIndexKey) { // TODO: Is there any reason to use a different encoding here for the actual value storage? Or is the key encoding already space-efficient enough? return { value: orderableVarint.encode(number), auxiliaryBlob: undefined }; }, decode: function (buffer, offset) { let { value, bytesRead } = orderableVarint.decode(buffer.slice(offset)); return { bytesRead: bytesRead, value: value, auxiliaryBlob: undefined }; } };