nl_tokens: Installs a compatible password hashing function .
pl_tokens: function install ( name , algorithm ) { if ( typeof name !== 'string' || name === '' ) { throw new TypeError ( 'The algorithm name must be an non-empty string.' ) ; } if ( typeof algorithm !== 'object' || algorithm === null || Array . isArray ( algorithm ) ) { throw new TypeError ( 'The algorithm object must be an object.' ) ; } if ( typeof algorithm . hash !== 'function' ) { throw new TypeError ( 'The hash property of the algorithm object should be a function.' ) ; } if ( typeof algorithm . verify !== 'function' ) { throw new TypeError ( 'The verify property of the algorithm object should be a function.' ) ; } if ( typeof algorithm . identifiers !== 'function' ) { throw new TypeError ( 'The identifiers property of the algorithm object should be a function.' ) ; } if ( funcs [ name ] !== undefined ) { throw new TypeError ( ` ${ name } ` ) ; } const idfs = algorithm . identifiers ( ) ; for ( const an of queue ) { if ( funcs [ an ] . identifiers ( ) . some ( idf => idfs . indexOf ( idf ) !== - 1 ) ) { throw <mask> Error ( 'The identifiers property of the algorithm object clashes with the ones of another algorithm.' ) ; } } funcs [ name ] = Object . assign ( { } , algorithm ) ; Object . freeze ( funcs [ name ] ) ; queue . push ( name ) ; }