
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
github.com/soniah/evaler
https://github.com/soniah/evaler
Package evaler implements a simple floating point arithmetic expression evaluator.
Evaler uses Dijkstra's Shunting Yard algorithm to convert an
infix expression to postfix/RPN format, then evaluates
the RPN expression. The implementation is adapted from a Java implementation. The results
are returned as a *big.Rat.
result, err := evaler.Eval("1+2")
The operators supported are:
+ - * / ^ ** () < > <= >= == !=
(^ and ** are both exponent operators)
Logical operators like < (less than) or > (greater than) get lowest precedence,
all other precedence is as expected -
BODMAS.
Logical tests like < and > tests will evaluate to 0.0 for false and 1.0
for true, allowing expressions like:
3 * (1 < 2) # returns 3.0
3 * (1 > 2) # returns 0.0
Minus implements both binary and unary operations.
See evaler_test.go for more examples of using operators.
The trigonometric operators supported are:
sin, cos, tan, ln, arcsin, arccos, arctan
For example:
cos(1)
sin(2-1)
sin(1)+2**2
See evaler_test.go for more examples of using trigonometric operators.
EvalWithVariables() allows variables to be passed into expressions,
for example evaluate "x + 1", where x=5.
See evaler_test.go for more examples of using variables.
The math/big library doesn't have an exponent function ** and implenting one
for big.Rat numbers is non-trivial. As a work around, arguments are converted
to float64's, the calculation is done using the math.Pow() function, the
result is converted to a big.Rat and placed back on the stack.
".5 * 2") are failing - PR's welcomehttp://godoc.org/github.com/soniah/evaler
There are also a number of utility functions e.g. BigratToFloat(),
BigratToInt() that may be useful when working with evaler.
Contributions are welcome.
If you've never contributed to a Go project before here is an example workflow.
go get github.com/soniah/evalercd $GOPATH/src/github.com/soniah/evalergit remote rename origin upstreamgit remote add origin git@github.com:<your-github-username>/evaler.gitgit checkout -b developmentgit push -u origin development (setup where you push to, check it works)Sonia Hamilton sonia@snowfrog.net
Dem Waffles dem-waffles@server.fake - trigonometric operators
Modified BSD License (BSD-3)
[1] http://en.wikipedia.org/wiki/Shunting-yard_algorithm
[2] http://en.wikipedia.org/wiki/Reverse_Polish_notation
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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.

Research
A malicious package uses a QR code as steganography in an innovative technique.

Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.