js-multiformats icon indicating copy to clipboard operation
js-multiformats copied to clipboard

feat!: BlockEncoder optional promise for encode/decode

Open mabels opened this issue 7 months ago • 1 comments

  Enable the BlockEncoder to use promise API in encode/decode methods.
  Why we need that:
    https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto
  To enable the promise to encode/decode a breaking change to 
  createUnsafe is required.
  The existing signature of createUnsafe can not pass a promise.
  Therefore the tests need to change.
  For me, measuring the blast radius of the change is impossible.
  If the blast radius is too big then there is still the possibility to
  create a new method createUnsafeAsync and throw an error
  in the createUnsafe if the decode sends a promise.
  

mabels avatar Jul 30 '24 06:07 mabels