fix!: identity hash is Hasher<"identity", 0>#314
Conversation
|
@achingbrain any qualms against this one? |
Co-authored-by: Alex Potsides <alex@achingbrain.net>
|
With hindsight E.g. // identity.ts
import type { SyncMultihashHasher } from './interface.js'
// ... other code
export const identity: SyncMultihashHasher<0x00> = { code, name, encode, digest }One problem is that One (breaking) solution would be remove the
Actually having |
|
Implementation of |
…to enable passing it where `MultihashHasher<Code>` instances are expected. It was also necessary to update the returned type of `from` to be `MultihashHasher<Code>` instead of the concrete `Hasher` type which has extra properties that are not part of hashing. Fixes #313 Supersedes #314 BREAKING CHANGE: all `Hasher`s are now `MultihashHasher<Code>`s
Updates the type of the identity hash to `SyncMultihashHasher<0x00>` to enable passing it where `MultihashHasher<Code>` instances are expected. It was also necessary to update the returned type of `from` to be `MultihashHasher<Code>` instead of the concrete `Hasher` type which has extra properties that are not part of hashing. Fixes #313 Supersedes #314 BREAKING CHANGE: all `Hasher`s are now `MultihashHasher<Code>`s
Updates the type of the identity hash to `SyncMultihashHasher<0x00>` to enable passing it where `MultihashHasher<Code>` instances are expected. It was also necessary to update the returned type of `from` to be `MultihashHasher<Code>` instead of the concrete `Hasher` type which has extra properties that are not part of hashing. Fixes #313 Supersedes #314 BREAKING CHANGE: all `Hasher`s are now `MultihashHasher<Code>`s
Updates the type of the identity hash to `SyncMultihashHasher<0x00>` to enable passing it where `MultihashHasher<Code>` instances are expected. It was also necessary to update the returned type of `from` to be `MultihashHasher<Code>` instead of the concrete `Hasher` type which has extra properties that are not part of hashing. Fixes #313 Supersedes #314 BREAKING CHANGE: all `Hasher`s are now `MultihashHasher<Code>`s
Updates the type of the identity hash to `SyncMultihashHasher<0x00>` to enable passing it where `MultihashHasher<Code>` instances are expected. It was also necessary to update the returned type of `from` to be `MultihashHasher<Code>` instead of the concrete `Hasher` type which has extra properties that are not part of hashing. Fixes #313 Supersedes #314 BREAKING CHANGE: all `Hasher`s are now `MultihashHasher<Code>`s
|
Closing in favour of #337 |
## [14.0.0](v13.4.2...v14.0.0) (2026-05-07) ### ⚠ BREAKING CHANGES * all `Hasher`s are now `MultihashHasher<Code>`s * Returned `Uint8Array`s are now `Uint8Array<ArrayBuffer>` ### Bug Fixes * identity hash is SyncMultihashHasher<0> ([#337](#337)) ([9b5b12b](9b5b12b)), closes [#313](#313) [#314](#314) * specify type of backing buffer when Uint8Arrays are returned ([#335](#335)) ([bac2da5](bac2da5))
Breaking change because return type no longer supports sync (aligns with other hashers)
Fixes #313