0.0.2 • Published 13 years ago

shorthash v0.0.2

Weekly downloads
35,728
License
-
Repository
github
Last release
13 years ago

shorthash

  • A mini Node.js module to generate short, alpha-number, undecryptable and unique hash id from a long string (utf8 format).
  • Use shorthash when you want to encrypt a string like a movie name or a people name to a short, unique and url friendly id.
  • so with shorthash, you can build an id-string map, instead of quering the id from db each time, you just calculate the id out on the fly.
  • it's quite convenient in many conditions if you want to build a site like 书本画, a book search engine in China.

Usage

less's more, no options, just unique the string.

var sh = require("shorthash");

console.log(sh.unique('foobar@example.com'));
// you will get: Z1bL2tE

console.log(sh.unique('my name is really big big and big...'));
// you will get: Z1TirWS

console.log(sh.unique('万里长城永不倒。。。'));
// you will get: 2r6EFF

console.log(sh.unique('和平'));
// you will get: 33NM
react-static-jurosh@wishtack/checklist-cli@kibalabs/react-staticpubsub-ddp-clientbabel-plugin-umi-intlumi-intl-babel-plugin@infinitebrahmanuniverse/nolb-shor@everything-registry/sub-chunk-2754svelte-formerstack-sightjuicy-replgtfs-utilshtml-usfm-pkhafas-rest-apiio-ng2-aot-fixer-pugmarkojslocal-scoped-scss-with-html-loaderlocal-scoped-scss-with-pug-loaderkuali-cor-workflows-common@vallemar/localizeangular-aot-fixer-pug11ty-dither@aappddeevv/dynamics-client@gsandf/react-static@eahefnawy/lego@sfdocs-internal/remark-lint-reference-path@sfdocs-internal/doc-frameworkstructure-corestubby-ampstyled-container-querystylesheetstyle-treestructure-short-id-servicestructure-storage-disk-adaptorsolid-clientultrafetchtile-stats-runnertructh@ball6847/talkback-cli@checkup/clivalist@kuali/cor-workflows-common@l1/fn@launchpadlab/react-static@mydiem/aot-fixer-pug@nativescript-community/l@nativescript/localize@module-federation/dev-plugin@quoine/react-staticmondrian-rest-clientmes-babel-plugin-intlnativescript-localizenativescript-loce-editor-tools-pknubank-ofx-previewpcachersan-markdown-doc-loadersan-markdown-loaderscout-atomic-developmentrookie-corern-animatable-cached-imagepicachepicache2postcss-atomisedpubsub-client-ddpresponse-pickerreact-static-pro-maxreact-static-with-missing-depsint-bit-cqrssissi-coresissi-saysreact-staticreact-static-6react-static-fivetranreact-static-forksitteneturshorthash-cligh-blogsghp-blogsgrunt-cmp-buildercdk-pipelinesclashclinchdenke-noteava-playbackfsbxfz-codex-app@stater/boot@stoplight/react-staticeleventy-plugin-local-imagesesoftplay-devexpo-managed-azikar24-templateexpo-cache-imagefirmament-vitafirmament-yargs@solidgoldpig/fb-runner-node@awly/marko@derhuerst/stable-public-transport-ids@marmicode/checklist-cli@marmicode/jwtgen
0.0.2

13 years ago

0.0.1

13 years ago