Questions tagged [uint8array]

The Uint8Array typed array represents an array of 8-bit unsigned integers.

162 questions
4
votes
3 answers

Sending Uint8Array (BSON) in a JSON object

I'm using the 'bson' npm package in the browser for converting / serializing a JSON object to BSON. The documentation says that it returns a Node.js buffer. The documentation of Node.js says that a buffer is of type 'Uint8Array'. Now I want to send…
La0x1
  • 145
  • 1
  • 2
  • 11
3
votes
1 answer

How to get file contents from ipfs-http-client

I am using ipfs-http-client to read the contents of a file form infura, how do i use the "cat" funtionality to correctly get the data in a string/json format? const client = create({ url: ipfsUrl(), headers: { authorization:…
Emmanuel Thomas
  • 159
  • 1
  • 12
3
votes
1 answer

web crypto api - how to export key pair?

This is what I've got so far to export a public and private key from a keypair: let pub = await crypto.subtle.exportKey("spki", keyPair.publicKey); let prv = await crypto.subtle.exportKey("spki", keyPair.privateKey); This results in two individual…
3
votes
0 answers

Convert Uint8ClampedArray to Image file as shown below and tell me solution

I want to convert Uint8ClampedArray (as shown in image):- to an image file(as shown in image):- I want this conversion so that I can send that image file to an API in angular
V_for_Vj
  • 849
  • 1
  • 12
  • 30
3
votes
2 answers

How to store a 32-bit integer in an arraybuffer?

I seem to not be understanding the Uint32Array. According to what I've read about the Uint8Array I could just feed it a number inside an array (Uint8Array([16]) or Uint8Array([96,56])) and the results are exactly that. However, when I try the same…
Edward
  • 495
  • 1
  • 6
  • 20
3
votes
2 answers

How to properly use fromCharCode.apply with Uint8Array in TypeScript 3?

So I have some code that I inherited that looks like this: String.fromCharCode.apply(null, new Uint8Array(license)); Recently, we had to update the project dependencies and we are not on TypeScript 3 which complains that the code is not correct…
ahetman
  • 1,274
  • 11
  • 17
3
votes
2 answers

Why is Blob of Array smaller than Blob of Uint8Array?

I read a file using FileReader.readAsArrayBuffer and then do something like this: var compressedData = pako.gzip(new Uint8Array(this.result)); var blob1 = new Blob([compressedData]); // size = 1455338 bytes var blob2 = new…
kodu
  • 2,176
  • 3
  • 17
  • 22
3
votes
0 answers

Get Image Uint8ClampedArray NodeJS

Is it possible to get pixels array in nodeJs without canvas or smth like that? Suppose I have image path. I tried several libraries but all of them need canvas or there's error with 'SOI not found'. For example that: var getPixels =…
Alex Johnson
  • 173
  • 3
  • 15
3
votes
2 answers

Convert uint8array to double in javascript

I have an arraybuffer and I want to get double values.For example from [64, -124, 12, 0, 0, 0, 0, 0] I would get 641.5 Any ideas?
user7597554
  • 95
  • 4
  • 11
3
votes
2 answers

React Native. MP3 Binary String (Uint8Array(9549)) to stream or file

I am trying to play an audio file with binary string format that Amazon Polly returns. For that, I am using 'react-native-fetch-blob' and reading a stream, but just keep getting errors from the bridge saying 'Invalid data message - all must be…
3
votes
1 answer

Uint8Array to JavaScript Object

I am trying to get an object from my AWS S3 bucket with the getObject function however, it seems like it returns a Uint8Array - which is an array of 8-bit unsigned integers. I can't figure out how to convert this back into my object I stored in my…
MatTaNg
  • 923
  • 8
  • 23
  • 41
3
votes
2 answers

Convert binary file to JavaScript string and then to Uint8Array

I'm trying to create a web application that can be used via a file:// URI. This means that I can't use AJAX to load binary files (without turning off security features in the browser, which I don't want to do as a matter of principle). The…
Jackson
  • 9,188
  • 6
  • 52
  • 77
2
votes
2 answers

Conver Uint8List to file in flutterweb

Hi I am having problem with uploading image inside flutter web and send it to server i need to send image us a File type to server before i ask, i will show u the code where i am struggling at import 'dart:html'; import 'dart:typed_data'; import…
Juda
  • 33
  • 4
2
votes
1 answer

How to convert async AsyncIterable to File in Javascript

Hello I'm sending/POST a File from a HTML Form on a browser client to a Remix application server. The Remix applicaton server is sending/handling my File as a async AsyncIterable. I now need to convert it back to a File object so I can send it to a…
Bobby
  • 243
  • 4
  • 13
2
votes
1 answer

Decoding Variant bytes from Godot to javascript object

I'm trying to deserialize a byte array which I believe is a Uint8 array from Godot into a javascript object in a node process. My current implementation is : const message = Buffer.from(buffer.data, 'ascii'); console.log('message',…
1
2
3
10 11