0.0.2 • Published 12 years ago

shorthash v0.0.2

Weekly downloads
35,728
License
-
Repository
github
Last release
12 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-repl@sfdocs-internal/remark-lint-reference-path@sfdocs-internal/doc-frameworkstructure-corestubby-ampstyled-container-querystylesheetstyle-treestructure-short-id-servicestructure-storage-disk-adaptorsolid-clientultrafetchtile-stats-runnertructh@asserted/models@awly/marko@ball6847/talkback-cli@checkup/cli11ty-dither@aappddeevv/dynamics-client@derhuerst/stable-public-transport-ids@deathstar/sputnik-infra@deathstar/sputnik-infra-core@datawheel/canon-vizbuildervalist@eahefnawy/lego@gsandf/react-static@huygn/react-static@freddyfy/styled-container-query@kuali/cor-workflows-common@l1/fn@launchpadlab/react-static@mydiem/aot-fixer-pug@marmicode/checklist-cli@marmicode/jwtgen@mas.io/miniux@nativescript-community/l@nativescript/localize@ministryofjustice/fb-runner-node@miniu/plugin-subwe@module-federation/dev-plugin@quoine/react-static@oce-editor-tools/joy-pk@oce-editor-tools/mui-pk@oce-editor-tools/pkmondrian-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-buildergtfs-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-pugcdk-pipelinesclashclinchdenke-note
0.0.2

12 years ago

0.0.1

12 years ago