paulmillr/noble-hashes

Lots of imports required to type a hash

Closed this issue · 2 comments

From some code I was working on recently

import { sha512, SHA512 } from '@noble/hashes/sha512'
import { Hash } from '@noble/hashes/utils'

export default class Sha512 {
  hash: Hash<SHA512>

In this case could simply do hash = sha512.create() but
Maybe it's fine, but it seems a bit involved?

Thoughts?

I think ReturnType<Type> should work here and would be less code