Comparing version 0.0.58 to 0.0.59
@@ -9,4 +9,18 @@ import { check } from "./system"; | ||
export class Checksum160 implements Packer { | ||
data!: u8[]; | ||
data: u8[]; | ||
constructor( | ||
data: u8[] | null = null | ||
){ | ||
this.data = new Array<u8>(20); | ||
if (data) { | ||
check(this.data.length == 20, "bad checksum length"); | ||
this.assign(data); | ||
} | ||
} | ||
assign(value: u8[]): void { | ||
check(value.length == 20, "bad assign length"); | ||
env.memcpy(this.data.dataStart, value.dataStart, 20); | ||
} | ||
pack(): u8[] { | ||
@@ -88,4 +102,18 @@ return this.data.slice(0); | ||
export class Checksum512 implements Packer { | ||
data!: u8[]; | ||
data: u8[]; | ||
constructor( | ||
data: u8[] | null = null | ||
){ | ||
this.data = new Array<u8>(64); | ||
if (data) { | ||
check(this.data.length == 64, "bad checksum length"); | ||
this.assign(data); | ||
} | ||
} | ||
assign(value: u8[]): void { | ||
check(value.length == 64, "bad assign length"); | ||
env.memcpy(this.data.dataStart, value.dataStart, 64); | ||
} | ||
pack(): u8[] { | ||
@@ -121,4 +149,18 @@ return this.data.slice(0); | ||
export class Checksum1024 implements Packer { | ||
data!: u8[]; | ||
data: u8[]; | ||
constructor( | ||
data: u8[] | null = null | ||
){ | ||
this.data = new Array<u8>(128); | ||
if (data) { | ||
check(this.data.length == 128, "bad checksum length"); | ||
this.assign(data); | ||
} | ||
} | ||
assign(value: u8[]): void { | ||
check(value.length == 128, "bad assign length"); | ||
env.memcpy(this.data.dataStart, value.dataStart, 128); | ||
} | ||
pack(): u8[] { | ||
@@ -125,0 +167,0 @@ return this.data.slice(0); |
{ | ||
"name": "as-chain", | ||
"version": "0.0.58", | ||
"version": "0.0.59", | ||
"description": "chain module for assemblyscript", | ||
@@ -5,0 +5,0 @@ "main": "js/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1574417
6670