1.0.2 • Published 11 months ago

@smddev/hashconfig v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

Hash Config

Hash your json configuration to a string that can be passed as environment variable safely along with hash key.

Hashing Algorithm : "aes-192-cbc"

Example

Require

var hc = require("@smddev/hashconfig");

Build Hash

// Build from json
var source = {
    key : "Value"
};

var hashedConfigString = hc.encode(source,"mysecret");

// Build from file
var hashedConfigString = hc.fromFile("path/to/json/file","mysecret");

Load Environment Configuration

const hc = require("@smddev/hashconfig");

hc.load({
    keyvarname : "configkey", // Name of environment variable that contains hash key
    sourcevarname : "config"  // Name of environment variable that contains hashed config
});

const config = hc.get();
1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago