REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 2.23 KB
Close
/home/byroehnu/.trash/node_modules11/restructure/src/Number.js
Text
Base64
import {DecodeStream} from './DecodeStream.js'; import {Base} from './Base.js'; class NumberT extends Base { constructor(type, endian = 'BE') { super(); this.type = type; this.endian = endian; this.fn = this.type; if (this.type[this.type.length - 1] !== '8') { this.fn += this.endian; } } size() { return DecodeStream.TYPES[this.type]; } decode(stream) { return stream[`read${this.fn}`](); } encode(stream, val) { return stream[`write${this.fn}`](val); } } export {NumberT as Number}; export const uint8 = new NumberT('UInt8'); export const uint16be = new NumberT('UInt16', 'BE'); export const uint16 = uint16be; export const uint16le = new NumberT('UInt16', 'LE'); export const uint24be = new NumberT('UInt24', 'BE'); export const uint24 = uint24be; export const uint24le = new NumberT('UInt24', 'LE'); export const uint32be = new NumberT('UInt32', 'BE'); export const uint32 = uint32be; export const uint32le = new NumberT('UInt32', 'LE'); export const int8 = new NumberT('Int8'); export const int16be = new NumberT('Int16', 'BE'); export const int16 = int16be; export const int16le = new NumberT('Int16', 'LE'); export const int24be = new NumberT('Int24', 'BE'); export const int24 = int24be; export const int24le = new NumberT('Int24', 'LE'); export const int32be = new NumberT('Int32', 'BE'); export const int32 = int32be; export const int32le = new NumberT('Int32', 'LE'); export const floatbe = new NumberT('Float', 'BE'); export const float = floatbe; export const floatle = new NumberT('Float', 'LE'); export const doublebe = new NumberT('Double', 'BE'); export const double = doublebe; export const doublele = new NumberT('Double', 'LE'); export class Fixed extends NumberT { constructor(size, endian, fracBits = size >> 1) { super(`Int${size}`, endian); this._point = 1 << fracBits; } decode(stream) { return super.decode(stream) / this._point; } encode(stream, val) { return super.encode(stream, (val * this._point) | 0); } } export const fixed16be = new Fixed(16, 'BE'); export const fixed16 = fixed16be; export const fixed16le = new Fixed(16, 'LE'); export const fixed32be = new Fixed(32, 'BE'); export const fixed32 = fixed32be; export const fixed32le = new Fixed(32, 'LE');
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 17
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
Array.js
2.43 KB
lrw-r--r--
2026-02-14 19:19:14
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Base.js
412 B
lrw-r--r--
2026-02-14 19:19:14
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Bitfield.js
741 B
lrw-r--r--
2026-02-14 19:19:14
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Boolean.js
398 B
lrw-r--r--
2026-02-14 19:19:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Buffer.js
795 B
lrw-r--r--
2026-02-14 19:19:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DecodeStream.js
1.85 KB
lrw-r--r--
2026-02-14 19:19:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
EncodeStream.js
3.13 KB
lrw-r--r--
2026-02-14 19:19:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Enum.js
533 B
lrw-r--r--
2026-02-14 19:19:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
LazyArray.js
1.62 KB
lrw-r--r--
2026-02-14 19:19:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Number.js
2.23 KB
lrw-r--r--
2026-02-14 19:19:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Optional.js
920 B
lrw-r--r--
2026-02-14 19:19:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Pointer.js
4.09 KB
lrw-r--r--
2026-02-14 19:19:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Reserved.js
519 B
lrw-r--r--
2026-02-14 19:19:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
String.js
3.71 KB
lrw-r--r--
2026-02-14 19:19:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Struct.js
2.33 KB
lrw-r--r--
2026-02-14 19:19:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
utils.js
723 B
lrw-r--r--
2026-02-14 19:19:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
VersionedStruct.js
3.01 KB
lrw-r--r--
2026-02-14 19:19:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).