0.0.2 • Published 11 years ago

shorthash v0.0.2

Weekly downloads
35,728
License
-
Repository
github
Last release
11 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-2754@asserted/modelsangular-aot-fixer-pug@aappddeevv/dynamics-client@solidgoldpig/fb-runner-node11ty-ditherava-playback@ball6847/talkback-cli@awly/markomes-babel-plugin-intlmarkojsnubank-ofx-previewoce-editor-tools-pk@derhuerst/stable-public-transport-idsmondrian-rest-clientnativescript-localizenativescript-ldenke-notepcacherpicache2picachepostcss-atomised@sfdocs-internal/remark-lint-reference-path@sfdocs-internal/doc-framework@stater/boot@vallemar/localize@stoplight/react-static@checkup/clicdk-pipelines@datawheel/canon-vizbuilder@deathstar/sputnik-infra@deathstar/sputnik-infra-corerookie-core@huygn/react-staticrn-animatable-cached-image@gsandf/react-staticclashkuali-cor-workflows-commonlocal-scoped-scss-with-html-loaderlocal-scoped-scss-with-pug-loaderclinchexpo-managed-azikar24-templateexpo-cache-imageshorthash-cli@eahefnawy/lego@freddyfy/styled-container-queryreact-static-with-missing-depreact-static-fivetranreact-static-forkreact-staticreact-static-6eleventy-plugin-local-imagesresponse-pickerpubsub-client-ddpsan-markdown-doc-loadersan-markdown-loaderesoftplay-devscout-atomic-developmentfirmament-vitafirmament-yargssint-bit-cqrssittenetursissi-coresolid-clientsissi-saysfsbxfz-codex-app@kuali/cor-workflows-common@launchpadlab/react-staticstructure-short-id-servicestructure-storage-disk-adaptorstyled-container-querystubby-ampgh-blogsghp-blogsstylesheethtml-usfm-pk@nativescript/localize@nativescript-community/l@l1/fnstack-sight@marmicode/checklist-cli@marmicode/jwtgen@mas.io/miniux@mydiem/aot-fixer-pughafas-rest-apistructure-corestyle-tree@oce-editor-tools/joy-pk@oce-editor-tools/mui-pk@oce-editor-tools/pktructhgrunt-cmp-builder
0.0.2

11 years ago

0.0.1

11 years ago