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.
github.com/nicored/avatar
Avatar is a package that allows you to create avatars for pictures and initials.
You can create square avatars, or round avatars.
size := 200
fileBytes, _ := ioutil.ReadFile("./test_data/super_mascot.jpg")
newAvatar, _ := NewAvatarFromPic(fileBytes, &PictureOptions{
Size: size, // default 300
})
round, err := newAvatar.Circle()
roundFile, _ := os.Create("./output/round_super_mascot.png")
roundFile.Write(round)
square, err := newAvatar.Square()
squareFile, _ := os.Create("./output/square_super_mascot.png")
roundFile.Write(square)
size := 200
newAvatar, err := NewAvatarFromInitials([]byte("John Smith"), &InitialsOptions{
FontPath: "./test_data/Arial.ttf", // Required
Size: size, // default 300
NInitials: 2, // default 1 - If 0, the whole text will be printed
TextColor: color.White, // Default White
BgColor: color.RGBA{0, 0, 255, 255}, // Default color.RGBA{215, 0, 255, 255} (purple)
})
square, _ := newAvatar.Square()
squareFile, _ := os.Create("./output/square_john_smith_initials.png")
defer squareFile.Close()
squareFile.Write(square)
round, _ := newAvatar.Circle()
roundFile, _ := os.Create("./output/round_john_smith_initials.png")
defer roundFile.Close()
roundFile.Write(round)
The input for initials can be any text, and the package identifies the best candidates for the initials.
If you give it an email address, it will try to identify the initials in the string preceding the @.
Not specifying NInitials in options would print the whole text as is.
And the font path is required, so maybe it should not be put in InitialsOptions, we'll see what the community thinks.
FAQs
Unknown package
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.