declare var hash: Hash; declare module "hash.js" { export default hash; } interface BlockHash { hmacStrength: number padLength: number endian: 'big' | 'little' } interface MessageDigest { blockSize: number outSize: number update(msg: any, enc?: 'hex'): T digest(enc?: 'hex'): T } interface Hash { hmac: HmacConstructor ripemd: RipemdSet ripemd160: Ripemd160Constructor sha: ShaSet sha1: Sha1Constructor sha224: Sha224Constructor sha256: Sha256Constructor sha384: Sha384Constructor sha512: Sha512Constructor utils: Utils } interface Utils { toArray(msg: any, enc: 'hex'): Array toHex(msg: any): string } interface RipemdSet { ripemd160: Ripemd160Constructor } interface ShaSet { sha1: Sha1Constructor sha224: Sha224Constructor sha256: Sha256Constructor sha384: Sha384Constructor sha512: Sha512Constructor } interface HmacConstructor { (hash: BlockHash, key: any, enc?: 'hex'): Hmac } interface Ripemd160Constructor { (): Ripemd160 } interface Sha1Constructor { (): Sha1; } interface Sha224Constructor { (): Sha224; } interface Sha256Constructor { (): Sha256; } interface Sha384Constructor { (): Sha384; } interface Sha512Constructor { (): Sha512; } interface Hmac extends MessageDigest { blockSize: 512 outSize: 160 } interface Ripemd160 extends BlockHash, MessageDigest { blockSize: 512 hmacStrength: 192 outSize: 160 padLength: 64 endian: 'little' } interface Sha1 extends BlockHash, MessageDigest { blockSize: 512 hmacStrength: 80 outSize: 160 padLength: 64 endian: 'big' } interface Sha224 extends BlockHash, MessageDigest { blockSize: 512 hmacStrength: 192 outSize: 224 padLength: 64 endian: 'big' } interface Sha256 extends BlockHash, MessageDigest { blockSize: 512 hmacStrength: 192 outSize: 256 padLength: 64 endian: 'big' } interface Sha384 extends BlockHash, MessageDigest { blockSize: 1024 hmacStrength: 192 outSize: 384 padLength: 128 endian: 'big' } interface Sha512 extends BlockHash, MessageDigest { blockSize: 1024 hmacStrength: 192 outSize: 512 padLength: 128 endian: 'big' }