4.0.0 • Published 2 years ago

uuid-by-string v4.0.0

Weekly downloads
12,489
License
MIT
Repository
github
Last release
2 years ago

uuid-by-string NPM Downloads

Build Status

Generates the RFC-4122 Name-Based UUID. Supports 3 and 5 versions of UUID.

Installation

# via NPM
npm install uuid-by-string

# or Yarn
yarn add uuid-by-string

Usage

The package has only one default exported method. Method receives any string and returns generated hash

const getUuid = require('uuid-by-string');

const uuidHash = getUuid('Hello world!');
// d3486ae9-136e-5856-bc42-212385ea7970

The string Hello world! will always returns d3486ae9-136e-5856-bc42-212385ea7970.

You can specify the UUID version. Available versions is 3 and 5 according to RFC-4122. The version is responsible for the hashing algorithm: version 3 uses MD5, and version 5 uses SHA-1. SHA-1 used by default if version is not specified.

const uuidV3Hash = getUuid('Hello world!', 3);
// 86fb269d-190d-3c85-b6e0-468ceca42a20

const uuidV5Hash = getUuid('Hello world!', 5);
// d3486ae9-136e-5856-bc42-212385ea7970

API

getUuid(name [, version]);

getUuid(name [, namespace, version]);

  • name — hashing target
  • namespace Optional — UUID namespace
  • version Optional — 3 or 5, version of UUID

License

MIT licensed

@halodex/apitrista_cal5-htp@everything-registry/sub-chunk-3034@vectara/searcherxes-apiepub-maker2saashq-api@infinitebrahmanuniverse/nolb-uusharedstreetsshortnrextract-md-datadropcell_core@golemio/shared-bikes@golemio/sorted-waste-stations@golemio/vehiclesharing@golemio/parkings@gleisbelegung/frontend@gleisbelegung/server@eohjsc/react-native-smart-city@eohjsc/react-native-smart-parkingfactbookfactbookjs@kenyip/bull@kontent-ai-consulting/migration-toolkit@kothawleprem/vectara-react-chatbot@kothawleprem/vectara-react-search-metadatafiltergenerator-jhipster-postgres-uuidjest-allure2-adapter@pocket-architect/coreupload-server-1fume-fhir-converter@js-soft/native-cordova@js-soft/native-electronforward-emailglobular-mvcsynflows-crm@mmisty/cypress-allure-adapter@nimra-traiq/sourcesthree-coverwhatsappilde@outburn/fume-engine@pidedirecto/clitristacle_coretristacle_engine@open_social_protocol/osp-client@os1-platform/console-ui-jshomebridge-wyze-smart-homemigratortronminecraft-launcherappium-grid@vectara/react-chatbot@vdtn359/utils@vdtn359/news-utilsapify-google-authashton-design-system@tomlbz/koishi-plugin-openaixeno-testwyze-apiz-deduperyosqlmaioresenimzindexerloop-hapi-pluginsall-airportsandoncloud-widget-preview@umuthopeyildirim/react-chatbotmeshblu-connector-installer-windows-msimerloc-cli5htp-coreautokubeosp-client-jsosp-jscia-world-leaderspocket-architect-corepostman-sdkpostman-collection-generatorlupdo-postgresyc-tx-api-walletparse-eth-tokens@alicloud/funnovel-epubnode-athena-utils@arkahna/nx-terraform@comet/cms-apiqr-utilsreact-flatifycssreact-bug-trap@david-vectara/react-chatbotraven-readerremarkable-times
4.0.0

2 years ago

3.0.7

2 years ago

3.0.6

2 years ago

3.0.5

2 years ago

3.0.4

3 years ago

3.0.3

3 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.1.5

5 years ago

2.1.4

5 years ago

2.1.3

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

2.0.0-alpha.1

5 years ago

2.0.0-alpha.0

5 years ago

0.6.0

6 years ago

0.5.2

6 years ago

0.5.1

6 years ago

0.5.0

6 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.0

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.1

8 years ago

0.1.0

8 years ago