
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
#Hash
DESCRIPTION
npm install eden-hash
var hash = require('eden-hash');
object concat(fname, lname ...);
Concats objects into one
object
var fname = 'Eliz';
var mi = 'B';
var lname = 'Bragais';
var age = 22;
fname.concat(lname);
fname.concat(' '.concat(mi.concat('.'.concat(' '.concat(lname)))));
fname+' '.concat(mi+'.'+' '+lname);
'Name:'+' '+fname+' '.concat(mi+'.'+' '+lname+'.'+' '+'Age:'+' '+age);
'ElizBragais'
'Eliz B. Bragais'
'Eliz B. Bragais'
'Name: Eliz B. Bragais. Age: 22'
bool each(key, value);
Custom for each loop that handles scopes and extra arguments
key - object
value - function
bool
var hash = {test1: 6, test2: 7, test3: 9, test4: [1,2,3,4,5]};
hashed().each(hash, function(key, value);
hash.hasOwnProperty(key);
value;
true
hash[key]
number|false indexOf(hash, 6, Boolis.has, Object, Mixed);
Returns true if the array has given value
hash - object
6 - mixed (if key value in object)
boolis.has - = function(data, value) {Argument Testingis.argument()est(1, 'object')est(2, 'mixed');turn !this.each(data, function(key, test) {turn !(test === value);;*Returns the index of where in the array the value is found
object
mixed
number|false
var hash = {test1: 6, test2: 7, test3: 9, test4: [1,2,3,4,5]};
hash().indexOf(hash, 6);
hash().indexOf(hash, 8);
'test1'
false
string implode({test1:4,test2:6}, '-');
Join array elements with a string
{test1:4,test2:6} - object
'-' - string (object separator)
string
hash().implode({test1:4,test2:6}, '-');
hash().implode({test1:4,test2:6}, '/');
'4-6'
'4/6'
bool isEmpty(hash);
Returns true if empty
bool
var hash = {test1: 6, test2: 7, test3: 9, test4: [1,2,3,4,5]};
var test = {};
hashed().isEmpty(hash);
hashed().isEmpty(test);
false
true
bool isHash(item1);
Returns true if given is hash
bool
var hash = {test1: 6, test2: 7, test3: 9, test4: [1,2,3,4,5]};
var item1 = {test1: 6, test2: 7, test3: 9, test4: [1,2,3,4,5]};
var item2 = Date;
var item3 = RegExp;
var item4 = Math;
var item5 = Array;
var item6 = Function;
var item7 = JSON;
var item8 = String;
var item9 = Boolean;
var item10 = Number;
var item11 = new Date();
var item12 = /[a-z]/;
var item13 = [1, 2, 3, 4]
var item14 = 'test';
var item15 = true;
var item16 = 123;
var item17 = function() {};
var item18 = null;
hash().isHash(item1);
hash().isHash(item2);
hash().isHash(item3);
hash().isHash(item4);
hash().isHash(item5);
hash().isHash(item6);
hash().isHash(item7);
hash().isHash(item8);
hash().isHash(item9);
hash().isHash(item10);
hash().isHash(item11);
hash().isHash(item12);
hash().isHash(item13);
hash().isHash(item14);
hash().isHash(item15);
hash().isHash(item16);
hash().isHash(item17);
hash().isHash(item18);
true
false
false
false
false
false
false
false
false
false
false
false
false
false
false
false
false
false
array keys(keys[0]);
Returns a list of keys
array
var hash = {test1: 6, test2: 7, test3: 9, test4: [1,2,3,4,5]};
var keys = hashed().keys(hash);
keys[0];
keys[1];
keys[3];
keys.length;
'test1'
'test2'
'test4'
4
object ksort({test3:9,test2:7,test1:6});
sorts hash by key
object
var result = hashed().ksort({test3:9,test2:7,test1:6});
result = hashed().implode(result, '-');
hash().ksort(result);
'6-7-9'
object krsort({test2:7,test3:9,test1:6});
reverse sorts hash by key
object
var result = hashed().krsort({test2:7,test3:9,test1:6});test1:6});
result = hashed().implode(result, '-');
hash().krsort(result);
'9-7-6'
object map(hash, (key, value), hash.test2);
Custom map loop that handles scopes and extra arguments
hash - object (locate the key value)
key, value - function
hash.test2 - [mixed[,mixed..]]
object
var hash = {test1: 6, test2: 7, test3: 9, test4: [1,2,3,4,5]};
hashed().map(hash, function(key, value) {
if(typeof value != 'number') {
return value;
}
return value + 1;
});
hash.test2;
hash.test3;
8
10
object natksort({test2:9,test1:7});
Rearranges objects where keys are natural sorted
object
var result = hashed().natksort({test2:9,test1:7});
result = hashed().implode(result, '-');
hash().natksort(result);
'7-9'
object natsort({test2:9,test1:7});
Sorts array by natural sort
object
var result = hashed().natsort({test2:9,test1:7});
result = hashed().implode(result, '-');
hash().natsort(result);
'7-9'
object reverse({test2:7,test3:9,test1:6});
Reverse sorts a hash with respect to its keys
object
var result = hashed().reverse({test2:7,test3:9,test1:6});test1:6});
result = hashed().implode(result, '-');
hash().reverse(result);
'9-7-6'
number size({test1:1,test:2});
Returns the size of the object
number
hash().size({test1:1,test2:2});
2
object sort({test3:4,test2:5,test1:1}, [callback]);
Sorts a hash with respect to its keys
{test3:4,test2:5,test1:1} - object (ascending order by values)
[callback]
object
var result = hashed().sort({test3:3,test2:2,test1:1});
result = hashed().implode(result, '-');
hash().sort(result);
'1-2-3'
string toQuery({test1: 6, test2: 7, test3: 9, test4: [1,2,3,4,5]});
Converts array to query string
string
var hash = {test1: 6, test2: 7, test3: 9, test4: [1,2,3,4,5]};
hash().toQuery(hash);
'test1=6&test2=7&test3=9&test4[0]=1&test4[1]=2&test4[2]=3&test4[3]=4&test4[4]=5'
string toString({test1: 6, test2: 7, test3: 9, test4: [1,2,3,4,5]});
Converts array to string
string
var hash = {test1: 6, test2: 7, test3: 9, test4: [1,2,3,4,5]};
hash().toString(hash);
'{"test1":6,"test2":7,"test3":9,"test4":[1,2,3,4,5]}'
array values({test1: 6, test2: 7, test3: 9, test4: [1,2,3,4,5]});
Returns a list of values
array
var hash = {test1: 6, test2: 7, test3: 9, test4: [1,2,3,4,5]};
var values = hashed().values(hash);
values[0];
values[1];
values[2];
values[4];
values.length;
6
7
9
undefined
4
FAQs
Eden Node JS Hash Methods
We found that eden-hash demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.