export function encodeCursor(cursor: string | number): string {
  return Buffer.from(`${cursor}`).toString('base64');
}

export function decodeCursor(cursor: string): string {
  return Buffer.from(cursor, 'base64').toString('ascii');
}

export function decodeOffsetCursor(cursor: string): number {
  return Number.parseInt(decodeCursor(cursor));
}
