1.0.0 • Published 4 years ago

geohash-compression v1.0.0

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

geohash-compression

Compressing string array of geohash

Example

const fs = require('fs');
const compressGeohashes = require('geohash-compression');

const hashes = JSON.parse(fs.readFileSync('./data.json'));

const compressedHashes = compressGeohashes(hashes);
console.log(`Uncompressed length: ${hashes.length}`);
console.log(`Compressed length: ${compressedHashes.length}`);

Result

Uncompressed length: 26953
Compressed length: 2339

data.json

["ezpgwfut","ezpgwfuv","ezpgwfvj","ezpgwfvm","ezpgwfvt","ezpgwfvv","ezpgwfyj","ezpgwfgh","ezpgwfgk","ezpgwfgs","ezpgwfgu","ezpgwfuh","ezpgwfuk","ezpgwfus","ezpgwfuu","ezpgwfvh","ezpgwfvk","ezpgwfvs","ezpgwfvu","ezpgwfyh","ezpgwfyk","ezpgwfys","ezpgwffg",...,"ezpgquns","ezpgqunu","ezpgquph","ezpgqupk","ezpgqups","ezpgqupu","ezpgqup7"]