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
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
javascript
const textToID = require('texttoid')
`$3
`javascript
let x = textToID('Hakan Özdaşçı')
console.log(x)
`
>1`javascript
let x = textToID('Today is Weater Cold')
console.log(x)
`
>2If you want to use difference databases
DEMO 2
`javascript
const textToID = require('texttoid')
`$3
`javascript
let x = textToID('İlknur Işık', true, 'documents')
console.log(x)
`
>1`javascript
let x = textToID('Today is Weater Cold', true, 'projects')
console.log(x)
`
>1`javascript
let x = textToID('Istanbul Metropolitan Municipality', true, 'projects')
console.log(x)
`
>2$3
`javascript
let x = textToID('Istanbul Metropolitan Municipality', false, 'projects')
console.log(x)
>>> false (cant found id)
>>> 5 (id found)
`$3
If you want to a new start for IDs (or remove database)
$3
`javascript
let x = textToID('', true, 'documents', 'delete')
console.log(x)
`
>documents removed. Now documents ID will start 1. $3
`javascript
let x = textToID('', true, 'projects', 'delete')
console.log(x)
`
>projects removed. Now projects ID will start 1. $3
`javascript
let x = textToID('', true, '', 'delete')
console.log(x)
``