
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
github.com/cryptography-research-lab/go-factorization
这是一个做因式分解的库,优势:
go get -u github.com/cryptography-research-lab/go-factorization
package main
import (
"fmt"
"github.com/cryptography-research-lab/go-factorization"
"time"
)
func main() {
beginTime := time.Now()
// 参数是要进行因式分解的数,返回值是进行因式分解的结果
factorization := factorization.Factorization(uint64(12343543765673436))
cost := time.Now().Sub(beginTime)
fmt.Println(factorization) // Output: [191749 6421127]
fmt.Println(cost) // Output: 132.167µs
}
package main
import (
"fmt"
"github.com/cryptography-research-lab/go-factorization"
"github.com/cryptography-research-lab/go-factorization/data"
"time"
)
func main() {
// 自定义素数表
table := factorization.NewPrimeNumberTable()
// 在这个地方可以使用自定义的素数表来初始化
// 格式是每行一个素数,按照从小到大排好序
err := table.Init(data.PrimeNumberTable)
if err != nil {
panic(err)
}
factorization.DefaultPrimeNumberTable = table
beginTime := time.Now()
// 参数是要进行因式分解的数,返回值是进行因式分解的结果
factorization := factorization.Factorization(uint64(12343543765673436))
cost := time.Now().Sub(beginTime)
fmt.Println(factorization) // Output: [191749 6421127]
fmt.Println(cost) // Output: 132.167µs
}
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.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
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.