Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stringerprint

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stringerprint - npm Package Compare versions

Comparing version 0.0.0 to 1.0.0

4

index.js

@@ -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`
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc