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

@xyo-network/data

Package Overview
Dependencies
Maintainers
0
Versions
347
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xyo-network/data - npm Package Compare versions

Comparing version 2.107.3 to 2.107.4

50

dist/browser/index.js

@@ -1,2 +0,50 @@

var e=class r{get length(){return this.bytes.byteLength}static is(t){return t instanceof r}};import{base16 as h,base58 as c}from"@scure/base";import{toArrayBuffer as o,toUint8Array as b}from"@xylabs/arraybuffer";import{assertEx as s}from"@xylabs/assert";import{keccak256 as y}from"ethers";var n=class r extends e{_bytes;_length;constructor(t,a,i){super(),this._bytes=b(a,t,i),this._length=t}get base58(){return this.checkLength(),c.encode(new Uint8Array(this.bytes))}get bytes(){return s(this._bytes,()=>"Data uninitialized")}get hex(){return this.checkLength(),h.encode(new Uint8Array(this.bytes)).toLowerCase()}get keccak256(){return this.checkLength(),o(y(new Uint8Array(this.bytes)))}static from(t){return t?new r(t.byteLength,t):void 0}checkLength(){s(this.bytes.byteLength===this._length,()=>`Length Mismatch: ${this.bytes.byteLength} !== ${this._length}`)}};export{e as AbstractData,n as Data};
// src/AbstractData.ts
var AbstractData = class _AbstractData {
get length() {
return this.bytes.byteLength;
}
static is(value) {
return value instanceof _AbstractData;
}
};
// src/Data.ts
import { base16, base58 } from "@scure/base";
import { toArrayBuffer, toUint8Array } from "@xylabs/arraybuffer";
import { assertEx } from "@xylabs/assert";
import { keccak256 } from "ethers";
var Data = class _Data extends AbstractData {
_bytes;
_length;
constructor(length, bytes, base) {
super();
this._bytes = toUint8Array(bytes, length, base);
this._length = length;
}
get base58() {
this.checkLength();
return base58.encode(new Uint8Array(this.bytes));
}
get bytes() {
return assertEx(this._bytes, () => "Data uninitialized");
}
get hex() {
this.checkLength();
return base16.encode(new Uint8Array(this.bytes)).toLowerCase();
}
get keccak256() {
this.checkLength();
return toArrayBuffer(keccak256(new Uint8Array(this.bytes)));
}
static from(data) {
return data ? new _Data(data.byteLength, data) : void 0;
}
checkLength() {
assertEx(this.bytes.byteLength === this._length, () => `Length Mismatch: ${this.bytes.byteLength} !== ${this._length}`);
}
};
export {
AbstractData,
Data
};
//# sourceMappingURL=index.js.map

@@ -1,2 +0,50 @@

var e=class r{get length(){return this.bytes.byteLength}static is(t){return t instanceof r}};import{base16 as h,base58 as c}from"@scure/base";import{toArrayBuffer as o,toUint8Array as b}from"@xylabs/arraybuffer";import{assertEx as s}from"@xylabs/assert";import{keccak256 as y}from"ethers";var n=class r extends e{_bytes;_length;constructor(t,a,i){super(),this._bytes=b(a,t,i),this._length=t}get base58(){return this.checkLength(),c.encode(new Uint8Array(this.bytes))}get bytes(){return s(this._bytes,()=>"Data uninitialized")}get hex(){return this.checkLength(),h.encode(new Uint8Array(this.bytes)).toLowerCase()}get keccak256(){return this.checkLength(),o(y(new Uint8Array(this.bytes)))}static from(t){return t?new r(t.byteLength,t):void 0}checkLength(){s(this.bytes.byteLength===this._length,()=>`Length Mismatch: ${this.bytes.byteLength} !== ${this._length}`)}};export{e as AbstractData,n as Data};
// src/AbstractData.ts
var AbstractData = class _AbstractData {
get length() {
return this.bytes.byteLength;
}
static is(value) {
return value instanceof _AbstractData;
}
};
// src/Data.ts
import { base16, base58 } from "@scure/base";
import { toArrayBuffer, toUint8Array } from "@xylabs/arraybuffer";
import { assertEx } from "@xylabs/assert";
import { keccak256 } from "ethers";
var Data = class _Data extends AbstractData {
_bytes;
_length;
constructor(length, bytes, base) {
super();
this._bytes = toUint8Array(bytes, length, base);
this._length = length;
}
get base58() {
this.checkLength();
return base58.encode(new Uint8Array(this.bytes));
}
get bytes() {
return assertEx(this._bytes, () => "Data uninitialized");
}
get hex() {
this.checkLength();
return base16.encode(new Uint8Array(this.bytes)).toLowerCase();
}
get keccak256() {
this.checkLength();
return toArrayBuffer(keccak256(new Uint8Array(this.bytes)));
}
static from(data) {
return data ? new _Data(data.byteLength, data) : void 0;
}
checkLength() {
assertEx(this.bytes.byteLength === this._length, () => `Length Mismatch: ${this.bytes.byteLength} !== ${this._length}`);
}
};
export {
AbstractData,
Data
};
//# sourceMappingURL=index.js.map

@@ -1,2 +0,50 @@

var e=class r{get length(){return this.bytes.byteLength}static is(t){return t instanceof r}};import{base16 as h,base58 as c}from"@scure/base";import{toArrayBuffer as o,toUint8Array as b}from"@xylabs/arraybuffer";import{assertEx as s}from"@xylabs/assert";import{keccak256 as y}from"ethers";var n=class r extends e{_bytes;_length;constructor(t,a,i){super(),this._bytes=b(a,t,i),this._length=t}get base58(){return this.checkLength(),c.encode(new Uint8Array(this.bytes))}get bytes(){return s(this._bytes,()=>"Data uninitialized")}get hex(){return this.checkLength(),h.encode(new Uint8Array(this.bytes)).toLowerCase()}get keccak256(){return this.checkLength(),o(y(new Uint8Array(this.bytes)))}static from(t){return t?new r(t.byteLength,t):void 0}checkLength(){s(this.bytes.byteLength===this._length,()=>`Length Mismatch: ${this.bytes.byteLength} !== ${this._length}`)}};export{e as AbstractData,n as Data};
// src/AbstractData.ts
var AbstractData = class _AbstractData {
get length() {
return this.bytes.byteLength;
}
static is(value) {
return value instanceof _AbstractData;
}
};
// src/Data.ts
import { base16, base58 } from "@scure/base";
import { toArrayBuffer, toUint8Array } from "@xylabs/arraybuffer";
import { assertEx } from "@xylabs/assert";
import { keccak256 } from "ethers";
var Data = class _Data extends AbstractData {
_bytes;
_length;
constructor(length, bytes, base) {
super();
this._bytes = toUint8Array(bytes, length, base);
this._length = length;
}
get base58() {
this.checkLength();
return base58.encode(new Uint8Array(this.bytes));
}
get bytes() {
return assertEx(this._bytes, () => "Data uninitialized");
}
get hex() {
this.checkLength();
return base16.encode(new Uint8Array(this.bytes)).toLowerCase();
}
get keccak256() {
this.checkLength();
return toArrayBuffer(keccak256(new Uint8Array(this.bytes)));
}
static from(data) {
return data ? new _Data(data.byteLength, data) : void 0;
}
checkLength() {
assertEx(this.bytes.byteLength === this._length, () => `Length Mismatch: ${this.bytes.byteLength} !== ${this._length}`);
}
};
export {
AbstractData,
Data
};
//# sourceMappingURL=index.js.map

6

package.json

@@ -21,4 +21,4 @@ {

"devDependencies": {
"@xylabs/ts-scripts-yarn3": "^3.11.9",
"@xylabs/tsconfig": "^3.11.9",
"@xylabs/ts-scripts-yarn3": "^3.11.10",
"@xylabs/tsconfig": "^3.11.10",
"typescript": "^5.5.2"

@@ -64,4 +64,4 @@ },

"sideEffects": false,
"version": "2.107.3",
"version": "2.107.4",
"type": "module"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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