Reference Source Test

Function

Static Public Summary
public

Convert a blob to an ArrayBuffer

version 1.0.0 since 1.0.0
public

blobToBinaryString(blob: Blob, chunk: Number): Promise<String>

Convert a blob to a binary string

version 1.0.0 since 1.0.0
public

Compares two buffers byte to byte

version 1.0.0 since 1.0.0

Static Public

public blobToArrayBuffer(blob: Blob, chunk: Number): Promise<ArrayBuffer> version 1.0.0 since 1.0.0 source

import {blobToArrayBuffer} from 'blob-compare/src/lib.js'

Convert a blob to an ArrayBuffer

The blob can optionnally be sliced with the sizeargument

Params:

NameTypeAttributeDescription
blob Blob

Blob

chunk Number

Size in bytes to slice blob

Return:

Promise<ArrayBuffer>

Binary data as a buffer

public blobToBinaryString(blob: Blob, chunk: Number): Promise<String> version 1.0.0 since 1.0.0 source

import {blobToBinaryString} from 'blob-compare/src/lib.js'

Convert a blob to a binary string

The blob can optionnaly be sliced with the slice arguments

Params:

NameTypeAttributeDescription
blob Blob

Blob to convert and optionnally sample

chunk Number

Size in bytes to slice blob

Return:

Promise<String>

Binary data as a string

public compareBuffers(buf1: ArrayBuffer, buf2: ArrayBuffer): Boolean version 1.0.0 since 1.0.0 source

import {compareBuffers} from 'blob-compare/src/lib.js'

Compares two buffers byte to byte

Params:

NameTypeAttributeDescription
buf1 ArrayBuffer

First buffer

buf2 ArrayBuffer

Second buffer

Return:

Boolean

true if buffers are equal