Mainly based on shorthash (apparently abandoned), by Bibig, shorthash2 offers a small optimization in memory usage, small features, typescript declarations and is available for browser and nodejs.
As NPM package:
$ npm i shorthash2
$ yarn add shorthash2
import shortHash from "shorthash2"; shortHash('firstname.lastname@example.org'); // => Z1bL2tE shortHash('my name is really big big and big...'); // => Z1TirWS shortHash('万里长城永不倒。。。'); // => 2r6EFF shortHash('和平'); // => 33NM