How to use the @0xcert/utils.sha function in @0xcert/utils

To help you get started, we’ve selected a few @0xcert/utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github 0xcert / framework / packages / 0xcert-client / src / core / client.ts View on Github external
public async init() {
    let msg = 'test';
    if (this.provider.signMethod === SignMethod.ETH_SIGN) {
      msg = await sha(256, msg);
    }

    const signature = await this.provider.sign(`0x${msg}`);
    const signatureType = this.provider.signMethod;
    this.authentication = `${signatureType}:${signature}`;

    let data = null;
    try {
      const accountData = await clientFetch(`${this.apiUrl}/account`, {
        method: 'GET',
        headers: {
          'Content-Type': 'application/json',
          'Authorization': this.authentication,
        },
      });
      data = accountData.data;
github 0xcert / framework / packages / 0xcert-cert / src / core / cert.ts View on Github external
      hasher: async (v: any) => sha(256, toString(v)),
      noncer: async (p) => sha(256, p.join('.')),
github 0xcert / framework / packages / 0xcert-cert / src / core / cert.ts View on Github external
public async identify(normalize?: boolean): Promise {
    return sha(256, JSON.stringify(
      normalize !== false ? this.sortSchema(this.schema) : this.schema,
    ));
  }

@0xcert/utils

General utility module with common helper functions.

MIT
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis