Function validateKeyHash

  • Parameters

    • value: string

    Returns ValidationResult

    0 (NO_PREFIX_MATCHED), 1 (INVALID_CHECKSUM), 2 (INVALID_LENGTH) or 3 (VALID).

    Used to check if a key hash is valid.

    import { validateKeyHash } from '@taquito/utils';
    const keyHashWithoutPrefix = '1L9r8mWmRPndRhuvMCWESLGSVeFzQ9NAWx'
    const validation = validateKeyHash(keyHashWithoutPrefix)
    console.log(validation)
    // This example return 0 which correspond to NO_PREFIX_MATCHED