src/libs/blake2b.js
function normalizeInput(input) {
    var ret;
    if (input instanceof Uint8Array) {
        ret = input;
    }
    else if (input instanceof Buffer) {
        ret = new Uint8Array(input);
    }
    else if (typeof (input) === 'string') {
        ret = new Uint8Array(Buffer.from(input, 'utf8'));
    }
    else {
        throw new Error(ERROR_MSG_INPUT);
    }
    return ret;
}
function normalizeInput(input) {
    var ret;
    if (input instanceof Uint8Array) {
        ret = input;
    }
    else if (input instanceof Buffer) {
        ret = new Uint8Array(input);
    }
    else if (typeof (input) === 'string') {
        ret = new Uint8Array(Buffer.from(input, 'utf8'));
    }
    else {
        throw new Error(ERROR_MSG_INPUT);
    }
    return ret;
}
function normalizeInput ( input ) { var ret ; if ( input instanceof Uint8Array ) { ret = input ; } else if ( input instanceof Buffer ) { ret = new Uint8Array ( input ) ; } else if ( typeof ( input ) === 'string' ) { ret = new Uint8Array ( Buffer . from ( input , 'utf8' ) ) ; } else { throw new Error ( ERROR_MSG_INPUT ) ; } return ret ; }
For convenience, let people hash a string, not just a Uint8Array
For convenience let people hash a string not just a Uint8Array