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/qiniu/iconv
iconv is a libiconv wrapper for go. libiconv Convert string to requested character encoding.
See http://godoc.org/github.com/qiniu/iconv
Note: Open returns a conversion descriptor cd, cd contains a conversion state and can not be used in multiple threads simultaneously.
go get github.com/qiniu/iconv
package main
import (
"fmt"
"github.com/qiniu/iconv"
)
func main() {
cd, err := iconv.Open("gbk", "utf-8") // convert utf-8 to gbk
if err != nil {
fmt.Println("iconv.Open failed!")
return
}
defer cd.Close()
gbk := cd.ConvString("你好,世界!")
fmt.Println(gbk)
}
package main
import (
"fmt"
"github.com/qiniu/iconv"
)
func main() {
cd, err := iconv.Open("gbk", "utf-8") // convert utf-8 to gbk
if err != nil {
fmt.Println("iconv.Open failed!")
return
}
defer cd.Close()
output := ... // eg. output := os.Stdout || ouput, err := os.Create(file)
autoSync := false // buffered or not
bufSize := 0 // default if zero
w := iconv.NewWriter(cd, output, bufSize, autoSync)
fmt.Fprintln(w, "你好,世界!")
w.Sync() // if autoSync = false, you need call Sync() by yourself
}
package main
import (
"fmt"
"io"
"os"
"github.com/qiniu/iconv"
)
func main() {
cd, err := iconv.Open("utf-8", "gbk") // convert gbk to utf8
if err != nil {
fmt.Println("iconv.Open failed!")
return
}
defer cd.Close()
input := ... // eg. input := os.Stdin || input, err := os.Open(file)
bufSize := 0 // default if zero
r := iconv.NewReader(cd, input, bufSize)
_, err = io.Copy(os.Stdout, r)
if err != nil {
fmt.Println("\nio.Copy failed:", err)
return
}
}
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.