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

obscurify

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

obscurify

Obscure database ids.

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

Obscurify

A simple pseudo-encryption function to obfuscate and restore numbers in JavaScript. Obscurify is particularly useful to create a more uniform and obfuscated form of a publicly visible number (i.e. an object's id number used in URLs).

build status

getting started

Include obscurify in the module in which you would like to use it. The function works both ways and thus is used both to obscure and restore the original value. It works on numbers up to 32 bits.

example

var obscurify = require('obscurify');

// obscurify!
var result = obscurify.pseudoEncrypt(1);
console.log(result);                          // 1919821825
console.log(obscurify.pseudoEncrypt(result)); // 1

Note that this is using the default values to generate the obfuscated number and will be the same as anyone using the default module. The generation may be changed by choosing different constants (3 6-digit numbers) using the init function as follows:

var obscurify = require('obscurify');

obscurify.init({
 c1: 324324,
 c2: 923405,
 c3: 329742
});

License

Code copyright 2015 Rocket Wagon Labs LLC. Code released under the MIT license.

FAQs

Package last updated on 25 Jul 2015

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