stringerprint
Advanced tools
Comparing version 0.0.0 to 1.0.0
@@ -8,2 +8,4 @@ const { createHash } = require('crypto'); | ||
*/ | ||
module.exports = string => createHash('md5').update(string, 'utf8').digest('hex'); | ||
module.exports = string => createHash('md5') | ||
.update(string, 'utf8') | ||
.digest('hex'); |
{ | ||
"name": "stringerprint", | ||
"version": "0.0.0", | ||
"version": "1.0.0", | ||
"description": "🧬 Create a unique, consistent, 32 char digest for a given string", | ||
@@ -16,12 +16,13 @@ "keywords": [ | ||
"type": "git", | ||
"url": "git+https://github.com/omrilotan/mono.git" | ||
"url": "git+https://github.com/omrilotan/stringerprint.git" | ||
}, | ||
"homepage": "https://omrilotan.com/mono/stringerprint/", | ||
"homepage": "https://omrilotan.com/stringerprint/", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "cd ../../; npm t packages/stringerprint; cd -" | ||
"test": "mocha spec.js" | ||
}, | ||
"publishConfig": { | ||
"tag": "latest" | ||
"dependencies": { | ||
"chai": "^4.2.0", | ||
"mocha": "^8.0.1" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# stringerprint [![](https://img.shields.io/npm/v/stringerprint.svg)](https://www.npmjs.com/package/stringerprint) [![](https://img.shields.io/badge/source--000000.svg?logo=github&style=social)](https://github.com/omrilotan/mono/tree/master/packages/stringerprint) | ||
# stringerprint [![](https://img.shields.io/npm/v/stringerprint.svg)](https://www.npmjs.com/package/stringerprint) [![](https://img.shields.io/badge/source--000000.svg?logo=github&style=social)](https://github.com/omrilotan/stringerprint) | ||
@@ -8,1 +8,17 @@ ## 🧬 Create a unique, consistent, 32 char digest (AKA fingerprint) for a given string | ||
``` | ||
**Use case**: Create a file fingerprint | ||
```js | ||
const { promises: { readFile, writeFile } } = require('fs'); | ||
const stringerprint = require('stringerprint'); | ||
const contents = await readFile(filename); | ||
const fingerprint = stringerprint(contents); | ||
const path = filename.split('.'); | ||
path.splice(array.length - 1, 0, fingerprint); | ||
await writeFile(path.join('.'), contents); | ||
``` | ||
- In: `/path/to/file.js` | ||
- Out: `/path/to/file.922a511f02d148e4c9390526d85ca519.js` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
1677
9
1
24
2
+ Addedchai@^4.2.0
+ Addedmocha@^8.0.1
+ Added@ungap/promise-all-settled@1.1.2(transitive)
+ Addedansi-colors@4.1.1(transitive)
+ Addedansi-regex@3.0.15.0.1(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedanymatch@3.1.3(transitive)
+ Addedargparse@2.0.1(transitive)
+ Addedassertion-error@1.1.0(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbinary-extensions@2.3.0(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedbraces@3.0.3(transitive)
+ Addedbrowser-stdout@1.3.1(transitive)
+ Addedcamelcase@6.3.0(transitive)
+ Addedchai@4.5.0(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedcheck-error@1.0.3(transitive)
+ Addedchokidar@3.5.1(transitive)
+ Addedcliui@7.0.4(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addeddebug@4.3.1(transitive)
+ Addeddecamelize@4.0.0(transitive)
+ Addeddeep-eql@4.1.4(transitive)
+ Addeddiff@5.0.0(transitive)
+ Addedemoji-regex@8.0.0(transitive)
+ Addedescalade@3.2.0(transitive)
+ Addedescape-string-regexp@4.0.0(transitive)
+ Addedfill-range@7.1.1(transitive)
+ Addedfind-up@5.0.0(transitive)
+ Addedflat@5.0.2(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedfsevents@2.3.3(transitive)
+ Addedget-caller-file@2.0.5(transitive)
+ Addedget-func-name@2.0.2(transitive)
+ Addedglob@7.1.6(transitive)
+ Addedglob-parent@5.1.2(transitive)
+ Addedgrowl@1.10.5(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedhe@1.2.0(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedis-binary-path@2.1.0(transitive)
+ Addedis-extglob@2.1.1(transitive)
+ Addedis-fullwidth-code-point@2.0.03.0.0(transitive)
+ Addedis-glob@4.0.3(transitive)
+ Addedis-number@7.0.0(transitive)
+ Addedis-plain-obj@2.1.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedjs-yaml@4.0.0(transitive)
+ Addedlocate-path@6.0.0(transitive)
+ Addedlog-symbols@4.0.0(transitive)
+ Addedloupe@2.3.7(transitive)
+ Addedminimatch@3.0.4(transitive)
+ Addedmocha@8.4.0(transitive)
+ Addedms@2.1.22.1.3(transitive)
+ Addednanoid@3.1.20(transitive)
+ Addednormalize-path@3.0.0(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedp-limit@3.1.0(transitive)
+ Addedp-locate@5.0.0(transitive)
+ Addedpath-exists@4.0.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedpathval@1.1.1(transitive)
+ Addedpicomatch@2.3.1(transitive)
+ Addedrandombytes@2.1.0(transitive)
+ Addedreaddirp@3.5.0(transitive)
+ Addedrequire-directory@2.1.1(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedserialize-javascript@5.0.1(transitive)
+ Addedstring-width@2.1.14.2.3(transitive)
+ Addedstrip-ansi@4.0.06.0.1(transitive)
+ Addedstrip-json-comments@3.1.1(transitive)
+ Addedsupports-color@7.2.08.1.1(transitive)
+ Addedto-regex-range@5.0.1(transitive)
+ Addedtype-detect@4.1.0(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedwide-align@1.1.3(transitive)
+ Addedworkerpool@6.1.0(transitive)
+ Addedwrap-ansi@7.0.0(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedy18n@5.0.8(transitive)
+ Addedyargs@16.2.0(transitive)
+ Addedyargs-parser@20.2.4(transitive)
+ Addedyargs-unparser@2.0.0(transitive)
+ Addedyocto-queue@0.1.0(transitive)