Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bitwrap

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitwrap - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

41

bitwrap.js
class Wrapp {
strE = s => new Uint8Array([...s].map(e => e.charCodeAt()))
StrE = s => [...s].map(e => e.charCodeAt())
ItB = n => n.toString(2)
BtI = n => +('0b' + n)
Check = a => a.pop ? true : console.error(new Error('Argument must be array'))
Check = a => a.pop ? true : console.error(new Error `Argument must be array`)
Rand(i = 1) {

@@ -17,13 +17,9 @@ let arr = [],

}
/*-----------------------------------------------------------------------------------*/
decodeArr(Arr) {
return [...Arr].map(e => e.pop ? this.decodeArr(e) : String.fromCharCode(e))
Pr = e => {
let x = e >> 8,
y = this.ItB(x).length - 8
return x ^ x >> y << y
}
smartCheck(Arr) {
return [...Arr].map(e => e.pop ? e.every(t => typeof t == 'string') ? e.join('') : this.smartCheck(e) : e)
}
decodeArr = Arr => [...Arr].map(e => e.pop ? this.decodeArr(e) : String.fromCharCode(e))
smartCheck = Arr => [...Arr].map(e => e.pop ? e.every(t => typeof t == 'string') ? e.join `` : this.smartCheck(e) : e)
arrayWrap(Arr) {

@@ -43,18 +39,8 @@ this.Check(Arr)

}
stringWrap(str) {
return this.arrayWrap([...this.strE(str)])
}
unWrap(Arr) {
return [...Arr].map(e => e.pop ? this.unWrap(e) : this.BtI((e >> 8).toString(2).slice(8)))
}
unWrapString(Arr) {
return this.smartCheck([this.decodeArr(this.unWrap(Arr))])
}
stringWrap = str => this.arrayWrap(this.StrE(str))
unWrap = Arr => [...Arr].map(e => e.pop ? this.unWrap(e) : this.Pr(e))
unWrapString = Arr => this.smartCheck([this.decodeArr(this.unWrap(Arr))])
smartWrap(Arr) {
this.Check(Arr)
let tarr = [...Arr].map(e => {
return [...Arr].map(e => {
switch (typeof e) {

@@ -70,3 +56,3 @@ case 'object':

case 'number':
return this.BtI(this.ItB(e) + this.ItB(this.Rand()[0]).padEnd(16, '0'))
return [...this.arrayWrap([e])][0]
default:

@@ -76,3 +62,2 @@ return 0;

})
return tarr
}

@@ -79,0 +64,0 @@ }

{
"name": "bitwrap",
"version": "1.0.4",
"version": "1.0.5",
"description": "A lightweight steganographic npm library.",

@@ -5,0 +5,0 @@ "main": "bitwrap.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc