/**
 * Package hash provides interface for hash functions.
 */ /**
 * Hash interface describes properties of
 * cryptographic hash functions.
 */ export interface Hash { readonly digestLength : number ; readonly blockSize : number ; update ( data ) : this ; reset ( ) : this ; finish ( out ) : this ; digest ( ) : Uint8Array ; clean ( ) : void ; } export interface SerializableHash extends Hash { saveState ( ) : any ; restoreState ( savedState ) : this ; cleanSavedState ( savedState ) : void ; } export function isSerializableHash ( h ) { return ( typeof ( h as SerializableHash ) . saveState !== "undefined" && typeof ( h as SerializableHash ) . restoreState !== "undefined" && typeof ( h as SerializableHash ) . cleanSavedState !== "undefined" ) ; }