Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
= fixedpnt
== DESCRIPTION
Binary Fixed Point calculations with Ruby.
fixedpnt allows simulating binary fixed point calculations done in hardware.
If you want to know what fixed point numbers are, you can read this: http://en.wikipedia.org/wiki/Fixed-point_arithmetic
There is another library from Phil Tomson which serves the same purpose but with different properties: http://rubyforge.org/projects/fixedpt/
For decimal fixed point calculations there is at least the library from Karl Brodowsky: http://rubyforge.org/projects/long-decimal/
== FEATURES/PROBLEMS:
GOALS:
IT HAS:
IT HAS NOT:
KNOWN ISSUES:
== SYNOPSIS:
EXAMPLE USAGE: require 'fixedpnt' include FixedPntModule $fixedpnt_track_min_max = true
a = fp(64, 8) b = fp(64, 8) c = fp
10000.times do |i| a.assign( i ) b.assign( 2.2 * i ) if i > 5000 c.is a - b else c.is a + b end end
puts "a.abs_min_max = " + a.abs_min_max.inspect #=> [0.0, 99999.0] puts "b.abs_min_max = " + b.abs_min_max.inspect #=> [0.0, 219997.796875] puts "c.abs_min_max = " + c.abs_min_max.inspect #=> [-119998.796875, 160000.0] puts "c.format = " + c.format.inspect #=> [65, 57, 8] p required_fp_format(0.001, 220000) #=> [30, 10]
GENERAL USAGE:
CREATION: FixedPnt.new(total_bits=nil, frac_width=nil, value=nil)
fp1 = FixedPnt.new(32,16, 1.234)
SHORTCUT to FixedPnt.new(...): include FixedPntModule fp(...)
ASSIGNMENT ( # # # IMPORTANT !! # # # )
"fp1 = ...": Use this in rare cases only! ("=": Assignment of variable name to object.)
instead, use (for speed and tracking):
"fp2.is(fp1)": Sets value (and format) of fp2 to equal fp1. fp2 and fp1 must have same format, OR: fp2's format is automatically taken from fp1 ("inherited"), OR raises error if formats are different. "fp3.is(fp1 + fp2"): fp3 and "fp1 + fp2" must have same format, OR: fp3's format is automatically taken from "fp1 + fp2" ("inherited"), OR raises error if formats are different. "fp1.assign( a_float)" or "fp1.assign( an_integer )": Assignes value to fp1. "fp2.fit(fp1)": Use this to reformat ("resize") fp1.
MEMORIZE: "is": left and right side are FixedPnt, formats are equal or automtically set; "fit": left and right side are FixedPnt, formats are unequal; "assign": left is FixedPnt, right is Numeric;
MIN-MAX-TRACKING: Stores min and max value ever assigned to this fixed-point instance. Tracking can be disabled by setting: $fixedpnt_track_min_max = false ;
== REQUIREMENTS:
(I used it with Ruby 1.8.7 and 1.9.3.)
== INSTALL:
== LICENSE:
(The MIT License)
Copyright (c) 2013 Axel Friedrich and contributors (see the CONTRIBUTORS file)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Unknown package
We found that fixedpnt demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.