UNPKG

@zodash/shorturl

Version:

Create short url from long url by Node Murmurhash

12 lines 406 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.shorturl = void 0; const murmurhash_1 = require("murmurhash"); const base62_1 = require("@zodash/base62"); function shorturl(longurl, seed) { const hash = murmurhash_1.v3(longurl, seed); return base62_1.default(hash); } exports.shorturl = shorturl; exports.default = shorturl; //# sourceMappingURL=shorturl.js.map