
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
svg-identicon
Advanced tools
While the GitHub-style identicons are well-designed and widely implemented, they're square. And while this is perfectly acceptable in many designs, variety in choice is never a bad thing. This project aims to apply the simplicity of GitHub identicons to other shapes and styles.
I'd love to hear how you use these!
The first thing you need to do is find a way to hash the data you want to "identify" with an identicon. For example, you could use MD5 to produce this transformation: "Hello, world!" => '6cd3556deb0da54bca060b4c39479839'). The hash doesn't need to be enormous, but should be more than 9 bytes. The function doesn't need to be complex, but each bit in the hash should have about a 50/50 chance of being 1 or 0. The less random the hash is, the more predictable the image will be, so just using incremental user ids is probably not enough for variation.
This hash can either be a string of hexadecimal digits or an ArrayBuffer.
An important note: this code is open source (obviously), does no further processing on the provided hashes, and may or may not use the entirety of the hash to generate an image. DO NOT use these identicons to represent sensitive data, even if you use some supposedly secure hashing algorithm. While it may be tempting to use something like the hex representation of a scrambled user email as a hash, please don't. That's equivalent to setting your user's public username to their email. Identicons are not encryption.
The best way to learn what the options do is to try them out here.
const identicon = require('svg-identicon')
identicon(options)
Not every option is used for every type of identicon.
'SQUARE', 'CIRCULAR', or 'POLYGONAL').128
null
null.'#EEEEEE'options.width0![]()
Required Options:
'SQUARE'Other Options:
![]()
Required Options:
'CIRCULAR'Other Options:
![]()
Required Options:
'POLYGONAL'Other Options:
The return value of identicon is the string representation of an SVG. You can save this to a file, parse it, add it to a DOM, log it, etc...
Node:
const fs = require('fs')
let svg = identicon({ type: 'SQUARE', hash: '1234567890ABCDEF' })
fs.writeFile(./'identicon.svg', svg, console.log)
Browser (after using webpack):
let svg = identicon({ type: 'SQUARE', hash: '1234567890ABCDEF' })
let container = document.getElementById("container");
container.innerHTML = svg;
FAQs
Various configurable identicon styles with SVG output.
The npm package svg-identicon receives a total of 8 weekly downloads. As such, svg-identicon popularity was classified as not popular.
We found that svg-identicon 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.

Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.

Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.