
Research
/Security News
60 Malicious Ruby Gems Used in Targeted Credential Theft Campaign
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
mygithub.libinneed.workers.dev/usk81/generic
flexible data type for Go
standard go get
:
go get -u github.com/usk81/generic
encode/decode:
package main
import (
"encoding/json"
"github.com/usk81/generic"
)
type User struct {
Name String `json:"name"`
Age generic.Int `json:"age"`
}
var user1 User
u1 := []byte(`{"name":"Daryl Dixon","age":"40"}`)
json.Unmarshal([]byte(u1), &user1)
b, _ := json.Marshal(user1)
Println(string(b))
// {"name":"Daryl Dixon","age":40}
var user2 User
u2 := []byte(`{"name":"Rick Grimes"}`)
json.Unmarshal([]byte(u2), &user2)
b, _ := json.Marshal(user2)
Println(string(b))
// {"name":"Rick Grimes","age":null}
set:
package main
import (
"fmt"
"github.com/usk81/generic"
)
func main() {
v := 1.0
var tb generic.Bool
tb.Set(v)
vb := tb.Value()
fmt.Printf("%v, (%T)\n", vb, vb)
// true, (bool)
var tf generic.Float
tf.Set(v)
vf := tf.Value()
fmt.Printf("%v, (%T)\n", vf, vf)
// 1, (float64)
var ti generic.Int
ti.Set(v)
vi := ti.Value()
fmt.Printf("%v, (%T)\n", vi, vi)
// 1, (int64)
var ts generic.String
ts.Set(v)
vs := ts.Value()
fmt.Printf("%v, (%T)\n", vs, vs)
// 1, (string)
var tt generic.Time
tt.Set(v)
vt := tt.Value()
fmt.Printf("%v, (%T)\n", vt.UTC(), vt)
// 1970-01-01 09:00:01 +0900 JST, (time.Time)
var tu generic.Uint
tu.Set(v)
vu := tu.Value()
fmt.Printf("%v, (%T)\n", vu, vu)
// 1, (uint64)
}
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 RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.