New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

float-array-to-string

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

float-array-to-string

convert/encode a float array as a hex string and back again.

latest
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

float-array-to-string

convert/encode a float array to a hex string and back again.

based on a stackoverflow post.

Installation

npm i float-array-to-string

Usage

var floatArray2Str = require('float-array-to-string');

var myFloats = [0.00001,2.123123213,3.14159265] ;

//note - encoder will cast array to a Float32Array if it is not already

var str = floatArray2Str.encodeFloatArr(myFloats);

console.log(str);

//acc5273740e10740db0f4940

console.log(floatArray2Str.decodeFloatArr(str));

// Float32Array(3) [
//         0.000009999999747378752, //notice the small error
//         2.1231231689453125,
//         3.1415927410125732
//     ]

See Also

  • int-compress-string - (de)compresses integer list to string

stonks

Keywords

convert

FAQs

Package last updated on 05 Apr 2022

Did you know?

Socket

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.

Install

Related posts