UNPKG

molstar

Version:

A comprehensive macromolecular library.

14 lines (13 loc) 430 B
/** * Copyright (c) 2020 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author David Sehnal <david.sehnal@gmail.com> */ export function isLittleEndian() { const arrayBuffer = new ArrayBuffer(2); const uint8Array = new Uint8Array(arrayBuffer); const uint16array = new Uint16Array(arrayBuffer); uint8Array[0] = 0xAA; uint8Array[1] = 0xBB; return uint16array[0] === 0xBBAA; }