HashObject
Defined in: packages/pythonlib/src/hashlib.ts:18
Hash object interface mimicking Python’s hash object. Note: digest() and hexdigest() are async to support Web Crypto API.
Properties
blockSize
readonlyblockSize:number
Defined in: packages/pythonlib/src/hashlib.ts:24
Internal block size in bytes
digestSize
readonlydigestSize:number
Defined in: packages/pythonlib/src/hashlib.ts:22
Digest size in bytes
name
readonlyname:string
Defined in: packages/pythonlib/src/hashlib.ts:20
Name of the hash algorithm
Methods
copy()
copy():
HashObject
Defined in: packages/pythonlib/src/hashlib.ts:32
Return a copy of the hash object
Returns
HashObject
digest()
digest():
Promise<Uint8Array<ArrayBufferLike>>
Defined in: packages/pythonlib/src/hashlib.ts:28
Return the digest as bytes (async)
Returns
Promise<Uint8Array<ArrayBufferLike>>
hexdigest()
hexdigest():
Promise<string>
Defined in: packages/pythonlib/src/hashlib.ts:30
Return the digest as a hexadecimal string (async)
Returns
Promise<string>
update()
update(
data:string|Uint8Array<ArrayBufferLike>):void
Defined in: packages/pythonlib/src/hashlib.ts:26
Update the hash with data (sync - buffers data)
Parameters
| Parameter | Type |
|---|---|
data | string | Uint8Array<ArrayBufferLike> |
Returns
void