Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/bases/interface.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Base encoders / decoders just base encode / decode between binary and
// textual represenatinon. They are unaware of multibase.
// textual representation. They are unaware of multibase.

/**
* Base encoder just encodes bytes into base encoded string.
Expand All @@ -18,9 +18,9 @@ export interface BaseEncoder {
*/
export interface BaseDecoder {
/**
* Decodes **plain** (and not a multibase) string. Unilke
* decode
* @param text
* Decodes **plain** (and not a multibase) string. Unlike
* decode
* @param text
*/
baseDecode(text: string): Uint8Array
}
Expand All @@ -34,7 +34,7 @@ export interface BaseCodec {
}

/**
* Multibase represets base encoded strings with a prefix first character
* Multibase represents base encoded strings with a prefix first character
* describing it's encoding.
*/
export type Multibase<Prefix extends string> =
Expand Down Expand Up @@ -70,8 +70,8 @@ export interface MultibaseEncoder<Prefix extends string> {
export interface MultibaseDecoder<Prefix extends string> {
/**
* Decodes **multibase** string (which must have a multibase prefix added).
* If prefix does not match
* @param multibase
* If prefix does not match
* @param multibase
*/
decode(multibase: Multibase<Prefix>): Uint8Array
}
Expand Down
2 changes: 1 addition & 1 deletion src/cid.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ export class CID {
}

/**
* Decoded a CID from its binary representation at the begining of a byte
* Decoded a CID from its binary representation at the beginning of a byte
* array.
*
* Returns an array with the first element containing the CID and the second
Expand Down
14 changes: 11 additions & 3 deletions src/hashes/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
* Represents a multihash digest which carries information about the
* hashing alogrithm and an actual hash digest.
* hashing algorithm and an actual hash digest.
*/
// Note: In the current version there is no first class multihash
// representation (plain Uint8Array is used instead) instead there seems to be
Expand Down Expand Up @@ -31,7 +31,6 @@ export interface MultihashDigest {
bytes: Uint8Array
}


/**
* Hasher represents a hashing algorithm implementation that produces as
* `MultihashDigest`.
Expand All @@ -42,5 +41,14 @@ export interface MultihashHasher {
* @param {Uint8Array} input
*/
digest(input: Uint8Array): Promise<MultihashDigest>
}

/**
* Name of the multihash
*/
name: string

/**
* Code of the multihash
*/
code: number
}