Options
All
  • Public
  • Public/Protected
  • All
Menu

@textile/wallet

Index

Functions

hash160

  • hash160(buffer: string | Buffer): Buffer
  • Node style rmd160 + sha256 hash for use in the browser, with native hashing in node.

    API is the same as hashes in node

    Parameters

    • buffer: string | Buffer

    Returns Buffer

hmacSHA512

  • hmacSHA512(key: string | Buffer, data: string | Buffer): Buffer
  • Node style SHA512 HMAC for use in the browser, with native SHA512 HMAC in node.

    API is the same as HMACs in node

    Parameters

    • key: string | Buffer

      Secret key

    • data: string | Buffer

      Input data

    Returns Buffer

sign

  • sign(data: Buffer, secretKey: Buffer): Buffer
  • Signs the message using the secret key and returns a signed message

    Parameters

    • data: Buffer

      the message to sign

    • secretKey: Buffer

      the secret key to use for signing

    Returns Buffer

verify

  • verify(data: Buffer, signature: Buffer, publicKey: Buffer): boolean
  • Verifies the signature for the message.

    Parameters

    • data: Buffer

      the message for which to verify the signature

    • signature: Buffer

      the signature applied ot the message

    • publicKey: Buffer

      the public key of the signer

    Returns boolean

verifyChecksum

  • verifyChecksum(expected: Buffer, actual: Buffer): boolean
  • Verify two checksums against each other

    Parameters

    • expected: Buffer

      Expected checksum value

    • actual: Buffer

      Actual observed checksum value

    Returns boolean

    Whether the two checksums are equal