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

@thumbmarkjs/thumbmarkjs

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thumbmarkjs/thumbmarkjs - npm Package Compare versions

Comparing version 0.12.1 to 0.12.2

18

dist/components/canvas/canvas.js

@@ -6,2 +6,3 @@ "use strict";

var commonPixels_1 = require("../../utils/commonPixels");
var browser_1 = require("../system/browser");
/**

@@ -26,3 +27,4 @@ * A simple canvas finger printing function

resolve({
'commonImageDataHash': (0, hash_1.hash)(commonImageData.data.toString()).toString()
'commonImageDataHash': (0, hash_1.hash)(commonImageData.data.toString()).toString(),
'dataURL': imageDataToDataURL(commonImageData),
});

@@ -32,2 +34,13 @@ });

exports.default = generateCanvasFingerprint;
function imageDataToDataURL(imageData) {
var canvas = document.createElement('canvas');
var context = canvas.getContext('2d');
if (!context) {
throw new Error('Canvas context not supported');
}
canvas.width = imageData.width;
canvas.height = imageData.height;
context.putImageData(imageData, 0, 0);
return canvas.toDataURL();
}
function generateCanvasImageData() {

@@ -73,3 +86,4 @@ var canvas = document.createElement('canvas');

}
(0, factory_1.includeComponent)('canvas', generateCanvasFingerprint);
if ((0, browser_1.getBrowser)().name != 'Firefox')
(0, factory_1.includeComponent)('canvas', generateCanvasFingerprint);
//# sourceMappingURL=canvas.js.map

2

package.json
{
"name": "@thumbmarkjs/thumbmarkjs",
"version": "0.12.1",
"version": "0.12.2",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -56,2 +56,4 @@ # ThumbmarkJS

:warning: note, thumbmarkjs was published up to version 0.12.1 to NPM package `thumbmarkjs` and from v0.12.1 onwards will be published under `@thumbmarkjs/thumbmarkjs`. I'll occasionally update the old location, but please update your imports.
But bear in mind that the library is meant to be running in the browser. Let me know if the library fails on a server side import. However, `getFingerprint()` is not meant to be called server side.

@@ -58,0 +60,0 @@

Sorry, the diff of this file is not supported yet

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