Skip to content

Commit

Permalink
class to plain and version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert committed Dec 18, 2019
1 parent 6b57ada commit 85af464
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dcorejs-sdk",
"version": "3.0.2",
"version": "3.0.3",
"homepage": "https://decent.ch/",
"description": "DcoreJS SDK.",
"main": "./dist/index.js",
Expand Down
6 changes: 5 additions & 1 deletion src/utils/Utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as BaseX from "base-x";
import { serialize } from "class-transformer";
import { classToPlain, serialize } from "class-transformer";
import * as Crypto from "crypto";
import { createHash } from "crypto";
import * as Long from "long";
Expand Down Expand Up @@ -42,6 +42,10 @@ export class Utils {
return typeof value === "string" ? value : serialize(value);
}

public static toPlain(value: any): object {
return classToPlain(value);
}

public static generateNonce(power: number = 250): Long {
return Long.fromString(Utils.generateEntropy(power).toString("hex"), true, 16);
}
Expand Down

0 comments on commit 85af464

Please sign in to comment.