Skip to content

Commit 2724f8a

Browse files
Gozalarvagg
authored andcommitted
fix: add encode to identity
Fix API unintentional API change introduced by #160 which removed `encode` method.
1 parent 2a1a332 commit 2724f8a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/hashes/identity.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@ import * as Digest from './digest.js'
44
const code = 0x0
55
const name = 'identity'
66

7+
/**
8+
* @param {Uint8Array} input
9+
* @returns {Uint8Array}
10+
*/
11+
const encode = (input) => coerce(input)
12+
713
/**
814
* @param {Uint8Array} input
915
* @returns {Digest.Digest<typeof code, number>}
1016
*/
1117
const digest = (input) => Digest.create(code, coerce(input))
1218

13-
/** @type {import('./interface').SyncMultihashHasher<typeof code>} */
14-
export const identity = { code, name, digest }
19+
export const identity = { code, name, encode, digest }

0 commit comments

Comments
 (0)