@orangecheck/stamp-core / hashContent
Function: hashContent()
function hashContent(bytes: Uint8Array): {
hash: string;
length: number;
};
Defined in: stamp-core/src/stamp.ts:28
Compute {hash, length} for raw bytes. Convenience over the common
sha256(bytes) pattern that prefixes with sha256: and returns lowercase
hex. Pass the result to stamp({ content: hashContent(bytes), mime }) when
you don't want stamp() to hash the bytes itself.
Parameters
| Parameter | Type |
|---|---|
bytes | Uint8Array |
Returns
{
hash: string;
length: number;
}
| Name | Type | Defined in |
|---|---|---|
hash | string | stamp-core/src/stamp.ts:28 |
length | number | stamp-core/src/stamp.ts:28 |