| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/setFromHex | [Back] [Original] |
Get to know MDN better
setFromHex() Uint8Array Uint8Array 16
parseInt() radix 16
setFromHex(string)
stringUint8Array 16
Uint8Array.prototype.setFromBase64() 16
read16 16
writtenUint8Array Uint8Array byteLength
16 Uint8Array
const uint8Array = new Uint8Array(8);
const result = uint8Array.setFromHex("cafed00d");
console.log(result); // { read: 8, written: 4 }
console.log(uint8Array); // Uint8Array(8) [202, 254, 208, 13, 0, 0, 0, 0]
const uint8Array = new Uint8Array(4);
const result = uint8Array.setFromHex("cafed00d-some random stuff");
console.log(result); // { read: 8, written: 4 }
console.log(uint8Array); // Uint8Array(4) [202, 254, 208, 13]
setFromHex() Uint8Array TypedArray.prototype.subarray()
const uint8Array = new Uint8Array(8);
// 2
const result = uint8Array.subarray(2).setFromHex("cafed00d");
console.log(result); // { read: 8, written: 4 }
console.log(uint8Array);
// Uint8Array(8) [0, 0, 202, 254, 208, 13, 0, 0]
| ECMAScript 2027 LanguageSpecification # sec-uint8array.prototype.setfromhex |
| Web Proxy Viewer | New URL | Original Page |