Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@klippersubs/hashtable
Advanced tools
Hash table implementation.
yarn add @klippersubs/hashtable
import HashTable, { hashString } from '@klippersubs/hashtable';
const ht = new HashTable(hashString);
ht.set('Alice', '+7 987 654‑32‑10');
ht.set('Bob', '+81 987 654‑32‑10');
ht.set('Alice', '+81 012 345‑67‑89');
ht.delete('Bob');
console.log(ht.get('Alice'));
// → '+81 012 345‑67‑89'
console.log(ht.get('Bob'));
// → undefined
console.log(ht.has('Bob'));
// → false
import { StringTable } from '@klippersubs/hashtable';
const st = new StringTable();
st.set('Alice', '+7 987 654‑32‑10');
st.set('Bob', '+81 987 654‑32‑10');
st.set('Alice', '+81 012 345‑67‑89');
st.delete('Bob');
console.log(st.get('Alice'));
// → '+81 012 345‑67‑89'
console.log(st.get('Bob'));
// → undefined
console.log(st.has('Bob'));
// → false
Hash
Callback type for calculating a hash of key.
Generic params:
Key
— key type.Params:
key: Key
— a key to calculate hash.capacity: number
— hash table capacity.Return value:
number
— hash.hashString
Calculates a hash of string key.
Params:
key: string
— a key to calculate hash.capacity: number
— hash table capacity.Return value:
number
— hash.HashTable
Hash table class.
Generic params:
Key
— key type.Value
— value type.Params:
hash: Hash<Key>
— hash function.capacity: number = 8
— capacity of the hash table.set
Sets key–value pair.
Params:
key: Key
.value: Value
.Return value:
this
.get
Returns value of a key–value pair.
Params:
key: Key
.Return value:
Value
.has
Checks if key—value pair exists.
Params:
key: Key
.Return value:
boolean
.delete
Deletes key—value pair.
Params:
key: Key
.Return value:
this
.StringTable
Specialized hash table with string keys.
Generic params:
Value
— value type.Params:
capacity: number = 8
— capacity of the hash table.MIT
FAQs
Hash table implementation.
We found that @klippersubs/hashtable 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.