温馨提示:本站仅提供公开网络链接索引服务,不存储、不篡改任何第三方内容,所有内容版权归原作者所有
AI智能索引来源:http://www.bun.com/reference/bun/CryptoHasher
点击访问原文链接

Bun CryptoHasher class | API Reference | Bun

Bun CryptoHasher class | API Reference | BunBuildDocsReferenceGuidesBlogDiscord/Bun/CryptoHasherPalgorithmPalgorithmsPbyteLengthCoconstructorMcopyMdigestMhashMupdate

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/Bun/CryptoHasherPalgorithmPalgorithmsPbyteLengthCoconstructorMcopyMdigestMhashMupdate

class

CryptoHasherclass CryptoHasher

Hardware-accelerated cryptographic hash functions

Used for crypto.createHash()

readonly algorithm: SupportedCryptoAlgorithms

The algorithm chosen to hash the data

readonly byteLength: number

The length of the output hash in bytes

readonly static algorithms: SupportedCryptoAlgorithms[]

List of supported hash algorithms

These are hardware accelerated with BoringSSL

copy(): CryptoHasher;

Perform a deep copy of the hasher

digest(encoding: DigestEncoding): string;

Finalize the hash. Resets the CryptoHasher so it can be reused.

@param encoding

DigestEncoding to return the hash in. If none is provided, it will return a Uint8Array.

digest(): Buffer;

Finalize the hash and return a Buffer

digest(hashInto: TypedArray): TypedArray;

Finalize the hash

@param hashInto

TypedArray to write the hash into. Faster than creating a new one each time

update(input: BlobOrStringOrBuffer,inputEncoding?: Encoding): CryptoHasher;

Update the hash with data

static hash(algorithm: SupportedCryptoAlgorithms,input: BlobOrStringOrBuffer): Buffer;

Run the hash over the given data

@param input

string, Uint8Array, or ArrayBuffer to hash. Uint8Array or ArrayBuffer is faster.

static hash(algorithm: SupportedCryptoAlgorithms,input: BlobOrStringOrBuffer,hashInto: TypedArray): TypedArray;

Run the hash over the given data

@param input

string, Uint8Array, or ArrayBuffer to hash. Uint8Array or ArrayBuffer is faster.

@param hashInto

TypedArray to write the hash into. Faster than creating a new one each time

static hash(algorithm: SupportedCryptoAlgorithms,input: BlobOrStringOrBuffer,encoding: DigestEncoding): string;

Run the hash over the given data

@param input

string, Uint8Array, or ArrayBuffer to hash. Uint8Array or ArrayBuffer is faster.

@param encoding

DigestEncoding to return the hash in

Resources

ReferenceDocsGuidesDiscordMerch StoreGitHubBlog 

Toolkit

RuntimePackage managerTest runnerBundlerPackage runner

Project

Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicense

Baked with ❤️ in San Francisco

We're hiring →

Bun CryptoHasher class | API Reference | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    Hardware-accelerated cryptographic hash functions Used for `crypto.createHash()`