How to use the @polkadot/util-crypto.blake2AsU8a function in @polkadot/util-crypto

To help you get started, we’ve selected a few @polkadot/util-crypto 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 polkadot-js / api / packages / types / src / type / SignaturePayload.ts View on Github external
function sign (signerPair: IKeyringPair, u8a: Uint8Array): Uint8Array {
  const encoded = u8a.length > 256
    ? blake2AsU8a(u8a)
    : u8a;

  return signerPair.sign(encoded);
}
github polkadot-js / api / packages / types / src / type / Extrinsic.ts View on Github external
get hash (): Hash {
    return new Hash(
      blake2AsU8a(this.toU8a(), 256)
    );
  }
github polkadot-js / api / packages / types / src / codec / Raw.ts View on Github external
public get hash (): IHash {
    return new Raw(this.registry, blake2AsU8a(this.toU8a(), 256));
  }
github polkadot-js / api / packages / types / src / codec / Set.ts View on Github external
public get hash (): IHash {
    return new U8a(this.registry, blake2AsU8a(this.toU8a(), 256));
  }
github polkadot-js / ui / packages / ui-shared / src / polkadotIcon.ts View on Github external
const blake2 = (value: Uint8Array): Uint8Array =>
  blake2AsU8a(value, 512);
github polkadot-js / api / packages / types / src / codec / StructAny.ts View on Github external
public get hash (): IHash {
    return new Raw(this.registry, blake2AsU8a(this.toU8a(), 256));
  }
github polkadot-js / api / packages / types / src / primitive / Bool.ts View on Github external
public get hash (): IHash {
    return createType(this.registry, 'Hash', blake2AsU8a(this.toU8a(), 256));
  }
github polkadot-js / api / packages / types / src / primitive / Extrinsic / util.ts View on Github external
export function sign (signerPair: IKeyringPair, u8a: Uint8Array, options?: SignOptions): Uint8Array {
  const encoded = u8a.length > 256
    ? blake2AsU8a(u8a)
    : u8a;

  return signerPair.sign(encoded, options);
}
github polkadot-js / api / packages / metadata / src / Decorated / storage / fromMetadata / getHasher.ts View on Github external
  isBlake2256: (data: HasherInput): Uint8Array => blake2AsU8a(data, 256),
  isTwox128: (data: HasherInput): Uint8Array => xxhashAsU8a(data, 128),