@@ -110,6 +110,17 @@ const assert = require('assert');
|
110 | 110 | assert.ok(data.equals(new Uint8Array([0x6d, 0x6d, 0x6d, 0x0a, 0xf9, 0xe7]))); |
111 | 111 | } |
112 | 112 | |
| 113 | +// Test 48 bit |
| 114 | +{ |
| 115 | +const value = 0x1234567890ab; |
| 116 | +const data = Buffer.allocUnsafe(6); |
| 117 | +data.writeUIntBE(value, 0, 6); |
| 118 | +assert.ok(data.equals(new Uint8Array([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]))); |
| 119 | + |
| 120 | +data.writeUIntLE(value, 0, 6); |
| 121 | +assert.ok(data.equals(new Uint8Array([0xab, 0x90, 0x78, 0x56, 0x34, 0x12]))); |
| 122 | +} |
| 123 | + |
113 | 124 | // Test UInt |
114 | 125 | { |
115 | 126 | const data = Buffer.alloc(8); |
|