Blockchain Commons Components TypeScript Library - v1.0.0-alpha.13
    Preparing search index...

    Class Salt

    Implements

    • CborTaggedEncodable
    • CborTaggedDecodable<Salt>
    • UREncodable
    Index

    Methods

    • Create a new salt from data. Note: Does not validate minimum size to allow for CBOR deserialization.

      Parameters

      • data: Uint8Array

      Returns Salt

    • Create a specific number of bytes of salt.

      Parameters

      • count: number

      Returns Salt

      Error if the number of bytes is less than 8.

    • Create a specific number of bytes of salt using provided RNG.

      Parameters

      • count: number
      • rng: RandomNumberGenerator

      Returns Salt

      Error if the number of bytes is less than 8.

    • Create a number of bytes of salt chosen randomly from the given range.

      Parameters

      • minSize: number
      • maxSize: number

      Returns Salt

      Error if the minimum number of bytes is less than 8.

    • Create a number of bytes of salt chosen randomly from the given range using provided RNG.

      Parameters

      • minSize: number
      • maxSize: number
      • rng: RandomNumberGenerator

      Returns Salt

      Error if the minimum number of bytes is less than 8.

    • Create a number of bytes of salt generally proportionate to the size of the object being salted.

      Parameters

      • size: number

      Returns Salt

    • Create a number of bytes of salt generally proportionate to the size of the object being salted using provided RNG.

      Parameters

      • size: number
      • rng: RandomNumberGenerator

      Returns Salt

    • Generate a random salt with specified size (legacy alias for newWithLen).

      Parameters

      • size: number = 16

      Returns Salt

    • Generate a random salt with specified size using provided RNG (legacy alias).

      Parameters

      • rng: RandomNumberGenerator
      • size: number = 16

      Returns Salt

    • Generate a proportionally-sized salt (legacy alias for newForSize).

      Parameters

      • dataSize: number

      Returns Salt

    • Return true if the salt is empty (this is not recommended).

      Returns boolean

    • Returns the CBOR tags associated with Salt.

      Returns Tag[]

    • Returns the untagged CBOR encoding (as a byte string).

      Returns Cbor

    • Returns the tagged CBOR encoding.

      Returns Cbor

    • Returns the tagged value in CBOR binary representation.

      Returns Uint8Array

    • Creates a Salt by decoding it from untagged CBOR.

      Parameters

      • cbor: Cbor

      Returns Salt

    • Creates a Salt by decoding it from tagged CBOR.

      Parameters

      • cbor: Cbor

      Returns Salt

    • Static method to decode from tagged CBOR binary data.

      Parameters

      • data: Uint8Array

      Returns Salt

    • Static method to decode from untagged CBOR binary data.

      Parameters

      • data: Uint8Array

      Returns Salt

    • Returns the UR representation of the Salt. Note: URs use untagged CBOR since the type is conveyed by the UR type itself.

      Returns UR

    • Returns the UR string representation.

      Returns string