New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

texttoid

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

texttoid

This module convert a text to unique id. Unique ID is autoincrement number. It return always the same number for the same text. Only for Nodejs

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

This module convert a text to unique id. Unique ID is autoincrement number. It return always the same number for the same text. Only for Nodejs

Installation

  • $ npm i -g npm
  • $ npm init
  • $ npm i --save texttoid

DEMO 1

const textToID = require('texttoid')

For Example:

let x = textToID('Hakan Özdaşçı')
console.log(x)

1

let x = textToID('Today is Weater Cold')
console.log(x)

2

If you want to use difference databases

DEMO 2

const textToID = require('texttoid')

For Example:

let x = textToID('İlknur Işık', true, 'documents')
console.log(x)

1

let x = textToID('Today is Weater Cold', true, 'projects')
console.log(x)

1

let x = textToID('Istanbul Metropolitan Municipality', true, 'projects')
console.log(x)

2

If you dont want to a new ID, and then make second parameter false

let x = textToID('Istanbul Metropolitan Municipality', false, 'projects')
console.log(x)
>>> false (cant found id)
>>> 5 (id found)

It gives back always the same ID for the same textes

If you want to a new start for IDs (or remove database)

For Example 1:

let x = textToID('', true, 'documents', 'delete')
console.log(x)

documents removed. Now documents ID will start 1.

For Example 2:

let x = textToID('', true, 'projects', 'delete')
console.log(x)

projects removed. Now projects ID will start 1.

For Example 3: (Remove default database)

let x = textToID('', true, '', 'delete')
console.log(x)

db removed. Now db ID will start 1.

Keywords

autoincrement

FAQs

Package last updated on 31 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts